diff --git a/docs/source/contributing/bundle-size-optimization.md b/docs/source/contributing/bundle-size-optimization.md
new file mode 100644
index 0000000000..3c0c5c5348
--- /dev/null
+++ b/docs/source/contributing/bundle-size-optimization.md
@@ -0,0 +1,42 @@
+---
+myst:
+ html_meta:
+ "description": "Bundle size optimization in Volto"
+ "property=og:description": "Bundle size optimization in Volto"
+ "property=og:title": "Bundle size optimization"
+ "keywords": "Volto, Plone, frontend, React, Performance, guidelines"
+---
+
+(bundle-size-optimization-label)=
+
+# Bundle size optimization
+
+This document describes how to optimize the bundle size of components through {term}`lazy loading` to improve page load times.
+Contributors to Volto core should follow the guidelines in this document.
+
+
+## Lazy loading in core
+
+Since Volto 18, several core components use lazy loading to keep the final build size under control.
+
+For example, the `Form` components are lazy loaded, which means that the code for the form components is only loaded when the user navigates to a page that contains a form.
+A new index file has been created at `packages/volto/src/components/manage/Form/index.tsx` that exports the form components with lazy loading.
+The `export`s in the main components index (`packages/volto/src/components/index.js`) have been updated to export components from the new specific index.
+The same goes for other components that have been lazy loaded, such as the control panels and widgets.
+
+Several `import` statements have been updated to use the new lazy loaded components.
+For example, the `Form` component is now imported from `@plone/volto/components/manage/Form` instead of `@plone/volto/components/manage/Form/Form`.
+You should keep this in mind, and always import components from the specific component index files when available, while avoiding importing components from the main components index file, if possible.
+This should also help to reduce circular dependencies, and help the overall build performance in the long run.
+
+
+### Unit test components that use lazy loaded components
+
+If you import a component from a lazy loaded index, you can have issues with rendering these in unit tests.
+Mocks are provided for lazy loaded components and are available for you to use.
+This can be done by using the `jest.mock` function to mock the specific component index.
+For example, to mock the `Form` component and all other components in the `Form`-specific index, you can use the following code in your test file:
+
+```javascript
+jest.mock('@plone/volto/components/manage/Form');
+```
diff --git a/docs/source/contributing/index.md b/docs/source/contributing/index.md
index 1e914a43a4..cc6b8d03b2 100644
--- a/docs/source/contributing/index.md
+++ b/docs/source/contributing/index.md
@@ -47,12 +47,14 @@ The Volto Team reviews pull requests only from people with a GitHub account who
```{include} ./branch-policy.md
```
+
(contributing-install-volto-for-development-label)=
## Install Volto for development
For developing Volto, follow {doc}`developing-core`.
+
(contributing-translations-label)=
## Translations
@@ -125,6 +127,7 @@ redux
routing
icons
accessibility-guidelines
+bundle-size-optimization
typescript
volto-core-addons
version-policy
diff --git a/packages/coresandbox/src/components/Blocks/TestBlock/Data.tsx b/packages/coresandbox/src/components/Blocks/TestBlock/Data.tsx
index 814cac8004..104ea631ee 100644
--- a/packages/coresandbox/src/components/Blocks/TestBlock/Data.tsx
+++ b/packages/coresandbox/src/components/Blocks/TestBlock/Data.tsx
@@ -1,5 +1,5 @@
import { useIntl } from 'react-intl';
-import { BlockDataForm } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import type { BlockEditProps } from '@plone/types';
const TestBlockData = (props: BlockEditProps) => {
diff --git a/packages/volto-slate/news/5295.internal b/packages/volto-slate/news/5295.internal
new file mode 100644
index 0000000000..146a3378a2
--- /dev/null
+++ b/packages/volto-slate/news/5295.internal
@@ -0,0 +1 @@
+Update imports to work with the new code split components in Volto. @pnicolli
diff --git a/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx b/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx
index 397bff13fd..96a493e9aa 100644
--- a/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx
+++ b/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx
@@ -11,7 +11,8 @@ import cx from 'classnames';
import { defineMessages, injectIntl } from 'react-intl';
import Cell from './Cell';
-import { BlockDataForm, Icon, SidebarPortal } from '@plone/volto/components';
+import { Icon, SidebarPortal } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import TableSchema from './schema';
import rowBeforeSVG from '@plone/volto/icons/row-before.svg';
diff --git a/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx b/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx
index a94357f794..eeb1450dd9 100644
--- a/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx
+++ b/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx
@@ -12,11 +12,8 @@ import {
validateFileUploadSize,
} from '@plone/volto/helpers';
import config from '@plone/volto/registry';
-import {
- BlockDataForm,
- SidebarPortal,
- BlockChooserButton,
-} from '@plone/volto/components';
+import { SidebarPortal, BlockChooserButton } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { SlateEditor } from '@plone/volto-slate/editor';
import { serializeNodesToText } from '@plone/volto-slate/editor/render';
diff --git a/packages/volto-slate/src/elementEditor/PluginEditor.jsx b/packages/volto-slate/src/elementEditor/PluginEditor.jsx
index b7f866e7b7..e33b87ec27 100644
--- a/packages/volto-slate/src/elementEditor/PluginEditor.jsx
+++ b/packages/volto-slate/src/elementEditor/PluginEditor.jsx
@@ -3,7 +3,8 @@ import { isEqual } from 'lodash';
import React from 'react';
import { useDispatch } from 'react-redux';
import { ReactEditor } from 'slate-react';
-import { Icon as VoltoIcon, BlockDataForm } from '@plone/volto/components';
+import { Icon as VoltoIcon } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { setPluginOptions } from '@plone/volto-slate/actions';
import BaseSchemaProvider from './SchemaProvider';
diff --git a/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx b/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx
index 97385733a4..ba7367ccd9 100644
--- a/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx
+++ b/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx
@@ -9,7 +9,7 @@ import { MemoryRouter } from 'react-router-dom';
import { Provider, useSelector } from 'react-redux';
import { defineMessages, injectIntl } from 'react-intl';
-import { FormFieldWrapper } from '@plone/volto/components';
+import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
import SlateEditor from '@plone/volto-slate/editor/SlateEditor';
import { serializeNodes } from '@plone/volto-slate/editor/render';
import { makeEditor } from '@plone/volto-slate/utils';
diff --git a/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx b/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx
index 7730ddf557..a97f3c28de 100644
--- a/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx
+++ b/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx
@@ -1,6 +1,7 @@
import React from 'react';
import { Menu, Tab } from 'semantic-ui-react';
-import { Icon, ObjectWidget } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import { ObjectWidget } from '@plone/volto/components/manage/Widgets';
export const ObjectByTypeWidget = (props) => {
const { schemas, value = {}, onChange, errors = {}, id } = props;
diff --git a/packages/volto-slate/src/widgets/RichTextWidget.jsx b/packages/volto-slate/src/widgets/RichTextWidget.jsx
index 0428440681..6cc151ebc6 100644
--- a/packages/volto-slate/src/widgets/RichTextWidget.jsx
+++ b/packages/volto-slate/src/widgets/RichTextWidget.jsx
@@ -6,7 +6,7 @@
import React from 'react';
import isUndefined from 'lodash/isUndefined';
import isString from 'lodash/isString';
-import { FormFieldWrapper } from '@plone/volto/components';
+import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
import SlateEditor from '@plone/volto-slate/editor/SlateEditor';
import { createEmptyParagraph, createParagraph } from '../utils/blocks';
diff --git a/packages/volto/cypress/support/commands.js b/packages/volto/cypress/support/commands.js
index 0410029d94..6ae8849820 100644
--- a/packages/volto/cypress/support/commands.js
+++ b/packages/volto/cypress/support/commands.js
@@ -702,10 +702,7 @@ Cypress.Commands.add(
'pasteClipboard',
{ prevSubject: true },
(query, htmlContent) => {
- return cy
- .wrap(query)
- .type(' {backspace}')
- .trigger('paste', createHtmlPasteEvent(htmlContent));
+ return cy.wrap(query).trigger('paste', createHtmlPasteEvent(htmlContent));
},
);
diff --git a/packages/volto/cypress/support/e2e.js b/packages/volto/cypress/support/e2e.js
index 4698c07b09..a103bdc2c4 100644
--- a/packages/volto/cypress/support/e2e.js
+++ b/packages/volto/cypress/support/e2e.js
@@ -5,6 +5,15 @@ import './commands';
import { setupGuillotina, tearDownGuillotina } from './guillotina';
import { setup, teardown } from './reset-fixture';
+Cypress.on('uncaught:exception', (err) => {
+ // We are getting this error in Cypress tests but we don't use ResizeObserver ourselves
+ if (/ResizeObserver loop/.test(err.message)) {
+ // returning false here prevents Cypress from
+ // failing the test
+ return false;
+ }
+});
+
before(function () {
if (Cypress.env('API') === 'guillotina') {
tearDownGuillotina({ allowFail: true });
diff --git a/packages/volto/cypress/tests/core/controlpanels/upgrade.js b/packages/volto/cypress/tests/core/controlpanels/upgrade.js
index 20dd2fbbb9..8b30cf6d5e 100644
--- a/packages/volto/cypress/tests/core/controlpanels/upgrade.js
+++ b/packages/volto/cypress/tests/core/controlpanels/upgrade.js
@@ -39,11 +39,12 @@ describe('Upgrade Site Tests', () => {
body: {
...getUpgradeNeedsUpgrade,
},
- }).as('getSystemNeedsUpdate');
+ }).as('getUpgradeNeedsUpgrade');
cy.navigate('controlpanel');
cy.wait('@getSystemNeedsUpdate');
cy.findByText('Please continue with the upgrade.').click();
+ cy.wait('@getUpgradeNeedsUpgrade');
cy.get('.content-area').contains(
'The site configuration is outdated and needs to be upgraded.',
);
diff --git a/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js b/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js
index b34867f541..8e7519ee61 100644
--- a/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js
+++ b/packages/volto/cypress/tests/core/volto-slate/06-block-slate-format-link.js
@@ -100,7 +100,7 @@ describe('Block Tests: Links', () => {
it('As editor I can add a link and pressing enter does not add another link in the next block', function () {
// https://github.com/plone/volto/pull/5186
cy.get('#toolbar').click();
- cy.getSlate().type('Colorless green ideas sleep furiously');
+ cy.getSlateEditorAndType('Colorless green ideas sleep furiously');
cy.log('Create a Link');
@@ -111,8 +111,8 @@ describe('Block Tests: Links', () => {
'https://google.com{enter}',
);
cy.getSlate().should('have.descendants', 'a.slate-editor-link');
- cy.getSlate().type('{rightarrow}').type('{enter}');
- cy.getSlate().type('Hello').type('{enter}');
+ cy.getSlateEditorAndType('{rightarrow}').type('{enter}');
+ cy.getSlateEditorAndType('Hello').type('{enter}');
cy.toolbarSave();
diff --git a/packages/volto/news/5295.internal b/packages/volto/news/5295.internal
new file mode 100644
index 0000000000..c6a8273fb7
--- /dev/null
+++ b/packages/volto/news/5295.internal
@@ -0,0 +1 @@
+Reduced JavaScript bundle size of the production build. Code split several internal modules: Controlpanels, Form, Widgets among other small ones. @pnicolli @deodorhunter
diff --git a/packages/volto/package.json b/packages/volto/package.json
index eafd481366..b1cdeae2fc 100644
--- a/packages/volto/package.json
+++ b/packages/volto/package.json
@@ -301,6 +301,7 @@
"@testing-library/react": "14.2.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.8",
+ "@types/loadable__component": "^5.13.9",
"@types/lodash": "^4.14.201",
"@types/react": "^18",
"@types/react-dom": "^18",
diff --git a/packages/volto/src/components/index.js b/packages/volto/src/components/index.js
index 22bff3e1d7..bcd0f9a8f8 100644
--- a/packages/volto/src/components/index.js
+++ b/packages/volto/src/components/index.js
@@ -75,39 +75,54 @@ export { default as AlbumView } from '@plone/volto/components/theme/View/AlbumVi
export { default as Actions } from '@plone/volto/components/manage/Actions/Actions';
export { default as Add } from '@plone/volto/components/manage/Add/Add';
-export { default as AddonsControlpanel } from '@plone/volto/components/manage/Controlpanels/AddonsControlpanel';
-export { default as UndoControlpanel } from '@plone/volto/components/manage/Controlpanels/UndoControlpanel';
-export { default as Contents } from '@plone/volto/components/manage/Contents/Contents';
+export {
+ Controlpanels,
+ Controlpanel,
+ RulesControlpanel,
+ AddRuleControlpanel,
+ EditRuleControlpanel,
+ ConfigureRuleControlpanel,
+ UsersControlpanel,
+ RenderUsers,
+ UserGroupMembershipControlPanel,
+ GroupsControlpanel,
+ RenderGroups,
+ RelationsControlpanel,
+ AliasesControlpanel,
+ UndoControlpanel,
+ AddonsControlpanel,
+ ContentType,
+ ContentTypeLayout,
+ ContentTypeSchema,
+ ContentTypes,
+ VersionOverview,
+ UpgradeControlPanel,
+ ModerateComments,
+ DatabaseInformation,
+} from '@plone/volto/components/manage/Controlpanels';
+
export { default as Circle } from '@plone/volto/components/manage/Contents/circle';
-export { default as DatabaseInformation } from '@plone/volto/components/manage/Controlpanels/DatabaseInformation';
-export { default as Controlpanel } from '@plone/volto/components/manage/Controlpanels/Controlpanel';
-export { default as Controlpanels } from '@plone/volto/components/manage/Controlpanels/Controlpanels';
-export { default as AliasesControlpanel } from '@plone/volto/components/manage/Controlpanels/Aliases';
-export { default as ContentTypes } from '@plone/volto/components/manage/Controlpanels/ContentTypes';
-export { default as ContentType } from '@plone/volto/components/manage/Controlpanels/ContentType';
-export { default as ContentTypeLayout } from '@plone/volto/components/manage/Controlpanels/ContentTypeLayout';
-export { default as ContentTypeSchema } from '@plone/volto/components/manage/Controlpanels/ContentTypeSchema';
-export { default as ContentTypesActions } from '@plone/volto/components/manage/Controlpanels/ContentTypesActions';
-export { default as UsersControlpanel } from '@plone/volto/components/manage/Controlpanels/Users/UsersControlpanel';
-export { default as UserGroupMembershipControlPanel } from '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel';
-export { default as Relations } from '@plone/volto/components/manage/Controlpanels/Relations/Relations';
-export { default as GroupsControlpanel } from '@plone/volto/components/manage/Controlpanels/Groups/GroupsControlpanel';
-export { default as RulesControlpanel } from '@plone/volto/components/manage/Controlpanels/Rules/Rules';
-export { default as AddRuleControlpanel } from '@plone/volto/components/manage/Controlpanels/Rules/AddRule';
-export { default as EditRuleControlpanel } from '@plone/volto/components/manage/Controlpanels/Rules/EditRule';
-export { default as ConfigureRuleControlpanel } from '@plone/volto/components/manage/Controlpanels/Rules/ConfigureRule';
-export { default as UpgradeControlPanel } from '@plone/volto/components/manage/Controlpanels/UpgradeControlPanel';
-
-export { default as ModerateComments } from '@plone/volto/components/manage/Controlpanels/ModerateComments';
-export { default as VersionOverview } from '@plone/volto/components/manage/Controlpanels/VersionOverview';
+
export { default as Delete } from '@plone/volto/components/manage/Delete/Delete';
-export { default as Diff } from '@plone/volto/components/manage/Diff/Diff';
+export const Diff = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "HistoryView" */ '@plone/volto/components/manage/Diff/Diff'
+ ),
+);
+export const DiffField = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "HistoryView" */ '@plone/volto/components/manage/Diff/DiffField'
+ ),
+);
export { default as Display } from '@plone/volto/components/manage/Display/Display';
export { default as Edit } from '@plone/volto/components/manage/Edit/Edit';
-export { default as ModalForm } from '@plone/volto/components/manage/Form/ModalForm';
export { default as History } from '@plone/volto/components/manage/History/History';
export { default as Sharing } from '@plone/volto/components/manage/Sharing/Sharing';
-export { default as Rules } from '@plone/volto/components/manage/Rules/Rules';
+export const Rules = loadable(
+ () => import('@plone/volto/components/manage/Rules/Rules'),
+);
export { default as Aliases } from '@plone/volto/components/manage/Aliases/Aliases';
export { default as LinksToItem } from '@plone/volto/components/manage/LinksToItem/LinksToItem';
export { default as Workflow } from '@plone/volto/components/manage/Workflow/Workflow';
@@ -124,58 +139,74 @@ export { default as Types } from '@plone/volto/components/manage/Toolbar/Types';
export { default as Toast } from '@plone/volto/components/manage/Toast/Toast';
export { default as ManageTranslations } from '@plone/volto/components/manage/Multilingual/ManageTranslations';
-// Potentially could ve removed from index, since they are internal components and
-// we don't want them to end up in the main chunk
-export { default as Form } from '@plone/volto/components/manage/Form/Form';
-export { default as BlocksToolbar } from '@plone/volto/components/manage/Form/BlocksToolbar';
-export { default as UndoToolbar } from '@plone/volto/components/manage/Form/UndoToolbar';
-export { default as Field } from '@plone/volto/components/manage/Form/Field';
+export {
+ Field,
+ InlineForm,
+ ModalForm,
+ UndoToolbar,
+ BlocksToolbar,
+ BlockDataForm,
+ BlocksForm,
+ Form,
+} from '@plone/volto/components/manage/Form';
export { default as SearchTags } from '@plone/volto/components/theme/Search/SearchTags';
-export { default as CommentEditModal } from '@plone/volto/components/theme/Comments/CommentEditModal';
-export { default as ContentsBreadcrumbs } from '@plone/volto/components/manage/Contents/ContentsBreadcrumbs';
-export { default as ContentsIndexHeader } from '@plone/volto/components/manage/Contents/ContentsIndexHeader';
-export { default as ContentsItem } from '@plone/volto/components/manage/Contents/ContentsItem';
-export { default as ContentsUploadModal } from '@plone/volto/components/manage/Contents/ContentsUploadModal';
-export { default as ContentsPropertiesModal } from '@plone/volto/components/manage/Contents/ContentsPropertiesModal';
-export { default as ContentsRenameModal } from '@plone/volto/components/manage/Contents/ContentsRenameModal';
-export { default as ContentsWorkflowModal } from '@plone/volto/components/manage/Contents/ContentsWorkflowModal';
-export { default as ContentsTagsModal } from '@plone/volto/components/manage/Contents/ContentsTagsModal';
-export { default as RenderUsers } from '@plone/volto/components/manage/Controlpanels/Users/RenderUsers';
-export { default as RenderGroups } from '@plone/volto/components/manage/Controlpanels/Groups/RenderGroups';
-export { default as DiffField } from '@plone/volto/components/manage/Diff/DiffField';
+export { CommentEditModal } from '@plone/volto/components/theme/Comments';
+export {
+ Contents,
+ ContentsBreadcrumbs,
+ ContentsIndexHeader,
+ ContentsItem,
+ ContentsUploadModal,
+ ContentsPropertiesModal,
+ ContentsRenameModal,
+ ContentsWorkflowModal,
+ ContentsTagsModal,
+} from '@plone/volto/components/manage/Contents';
export { default as DragDropList } from '@plone/volto/components/manage/DragDropList/DragDropList';
-export { default as InlineForm } from '@plone/volto/components/manage/Form/InlineForm';
-export { default as BlocksForm } from '@plone/volto/components/manage/Blocks/Block/BlocksForm';
-export { default as BlockDataForm } from '@plone/volto/components/manage/Form/BlockDataForm';
-
-export { default as FormFieldWrapper } from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
-export { default as ArrayWidget } from '@plone/volto/components/manage/Widgets/ArrayWidget';
-export { default as CheckboxWidget } from '@plone/volto/components/manage/Widgets/CheckboxWidget';
-export const DatetimeWidget = loadable(
- () => import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
+export {
+ AlignWidget,
+ ButtonsWidget,
+ ArrayWidget,
+ CheckboxWidget,
+ FileWidget,
+ IdWidget,
+ PasswordWidget,
+ QueryWidget,
+ QuerySortOnWidget,
+ QuerystringWidget,
+ SchemaWidget,
+ SelectWidget,
+ TextareaWidget,
+ TextWidget,
+ TokenWidget,
+ WysiwygWidget,
+ UrlWidget,
+ InternalUrlWidget,
+ EmailWidget,
+ NumberWidget,
+ ImageSizeWidget,
+ RegistryImageWidget,
+ ReferenceWidget,
+ ObjectBrowserWidget,
+ ObjectWidget,
+ ObjectListWidget,
+ VocabularyTermsWidget,
+ SelectMetadataWidget,
+ SelectAutoComplete,
+ ColorPickerWidget,
+ DatetimeWidget,
+ RecurrenceWidget,
+ FormFieldWrapper,
+} from '@plone/volto/components/manage/Widgets';
+
+export const SchemaWidgetFieldset = loadable(
+ () => import('@plone/volto/components/manage/Widgets/SchemaWidgetFieldset'),
);
-export const RecurrenceWidget = loadable(
- () =>
- import(
- '@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
- ),
+export const ObjectBrowserWidgetMode = loadable(
+ () => import('@plone/volto/components/manage/Widgets/ObjectBrowserWidget'),
);
-export { default as FileWidget } from '@plone/volto/components/manage/Widgets/FileWidget';
-export { default as IdWidget } from '@plone/volto/components/manage/Widgets/IdWidget';
-export { default as PasswordWidget } from '@plone/volto/components/manage/Widgets/PasswordWidget';
-export { default as ReferenceWidget } from '@plone/volto/components/manage/Widgets/ReferenceWidget';
-export { default as SchemaWidget } from '@plone/volto/components/manage/Widgets/SchemaWidget';
-export { default as SchemaWidgetFieldset } from '@plone/volto/components/manage/Widgets/SchemaWidgetFieldset';
-export { default as SelectWidget } from '@plone/volto/components/manage/Widgets/SelectWidget';
-export { default as TextareaWidget } from '@plone/volto/components/manage/Widgets/TextareaWidget';
-export { default as TextWidget } from '@plone/volto/components/manage/Widgets/TextWidget';
-export { default as ObjectBrowserWidget } from '@plone/volto/components/manage/Widgets/ObjectBrowserWidget';
-export { default as ObjectBrowserWidgetMode } from '@plone/volto/components/manage/Widgets/ObjectBrowserWidget';
-export { default as ObjectWidget } from '@plone/volto/components/manage/Widgets/ObjectWidget';
-export { default as ObjectListWidget } from '@plone/volto/components/manage/Widgets/ObjectListWidget';
-
export { default as EditDefaultBlock } from '@plone/volto/components/manage/Blocks/Block/DefaultEdit';
export { default as EditDescriptionBlock } from '@plone/volto/components/manage/Blocks/Description/Edit';
export { default as EditTitleBlock } from '@plone/volto/components/manage/Blocks/Title/Edit';
diff --git a/packages/volto/src/components/manage/Actions/Actions.jsx b/packages/volto/src/components/manage/Actions/Actions.jsx
index 765ba01c20..9d063146c6 100644
--- a/packages/volto/src/components/manage/Actions/Actions.jsx
+++ b/packages/volto/src/components/manage/Actions/Actions.jsx
@@ -8,7 +8,8 @@ import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import { cut, copy, copyContent, moveContent } from '@plone/volto/actions';
import { getBaseUrl } from '@plone/volto/helpers';
-import { ContentsRenameModal, Toast } from '@plone/volto/components';
+import { Toast } from '@plone/volto/components';
+import { ContentsRenameModal } from '@plone/volto/components/manage/Contents';
const messages = defineMessages({
cut: {
diff --git a/packages/volto/src/components/manage/Actions/Actions.test.jsx b/packages/volto/src/components/manage/Actions/Actions.test.jsx
index ba2032f6a1..d66f98dabb 100644
--- a/packages/volto/src/components/manage/Actions/Actions.test.jsx
+++ b/packages/volto/src/components/manage/Actions/Actions.test.jsx
@@ -8,9 +8,7 @@ import Actions from './Actions';
const mockStore = configureStore();
-jest.mock('../Contents/ContentsRenameModal', () =>
- jest.fn(() =>
),
-);
+jest.mock('@plone/volto/components/manage/Contents');
describe('Actions', () => {
it('renders an actions component', () => {
diff --git a/packages/volto/src/components/manage/Actions/__snapshots__/Actions.test.jsx.snap b/packages/volto/src/components/manage/Actions/__snapshots__/Actions.test.jsx.snap
index 51c4c11017..db5940cde3 100644
--- a/packages/volto/src/components/manage/Actions/__snapshots__/Actions.test.jsx.snap
+++ b/packages/volto/src/components/manage/Actions/__snapshots__/Actions.test.jsx.snap
@@ -92,7 +92,7 @@ exports[`Actions renders an actions component 1`] = `
diff --git a/packages/volto/src/components/manage/Add/Add.jsx b/packages/volto/src/components/manage/Add/Add.jsx
index cf5057267b..0510b43f5a 100644
--- a/packages/volto/src/components/manage/Add/Add.jsx
+++ b/packages/volto/src/components/manage/Add/Add.jsx
@@ -23,13 +23,13 @@ import {
setFormData,
} from '@plone/volto/actions';
import {
- Form,
Icon,
Toolbar,
Sidebar,
Toast,
TranslationObject,
} from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import {
getBaseUrl,
hasBlocksData,
diff --git a/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx b/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx
index f15953cba0..f8fab927af 100644
--- a/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx
+++ b/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import config from '@plone/volto/registry';
import { useIntl } from 'react-intl';
import { SidebarPortal } from '@plone/volto/components';
-import { BlockDataForm } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import DefaultBlockView from './DefaultView';
const DefaultBlockEdit = (props) => {
diff --git a/packages/volto/src/components/manage/Blocks/Block/Settings.jsx b/packages/volto/src/components/manage/Blocks/Block/Settings.jsx
index 9c72d5a084..0501f324fd 100644
--- a/packages/volto/src/components/manage/Blocks/Block/Settings.jsx
+++ b/packages/volto/src/components/manage/Blocks/Block/Settings.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl } from 'react-intl';
-import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
const Settings = ({
data,
diff --git a/packages/volto/src/components/manage/Blocks/Block/Settings.test.jsx b/packages/volto/src/components/manage/Blocks/Block/Settings.test.jsx
index 8cc2a7f301..237b53d556 100644
--- a/packages/volto/src/components/manage/Blocks/Block/Settings.test.jsx
+++ b/packages/volto/src/components/manage/Blocks/Block/Settings.test.jsx
@@ -5,6 +5,8 @@ import configureStore from 'redux-mock-store';
import config from '@plone/volto/registry';
import { Provider } from 'react-intl-redux';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
const withStateManagement =
diff --git a/packages/volto/src/components/manage/Blocks/Block/__snapshots__/Settings.test.jsx.snap b/packages/volto/src/components/manage/Blocks/Block/__snapshots__/Settings.test.jsx.snap
index d60a35d1da..a629ca9637 100644
--- a/packages/volto/src/components/manage/Blocks/Block/__snapshots__/Settings.test.jsx.snap
+++ b/packages/volto/src/components/manage/Blocks/Block/__snapshots__/Settings.test.jsx.snap
@@ -3,15 +3,18 @@
exports[`Settings renders block settings form without schema enhancers 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"title\\": \\"Default\\",
+ \\"id\\": \\"default\\",
+ \\"fields\\": []
+ }
+ ],
+ \\"properties\\": {},
+ \\"required\\": []
+}"
+ id="BlockDataForm"
+ />
`;
diff --git a/packages/volto/src/components/manage/Blocks/Container/Data.jsx b/packages/volto/src/components/manage/Blocks/Container/Data.jsx
index 76c18b5c72..d9b24bf6e0 100644
--- a/packages/volto/src/components/manage/Blocks/Container/Data.jsx
+++ b/packages/volto/src/components/manage/Blocks/Container/Data.jsx
@@ -1,5 +1,5 @@
import { useIntl } from 'react-intl';
-import { BlockDataForm } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
const ContainerData = (props) => {
const { block, blocksConfig, data, onChangeBlock, navRoot, contentType } =
diff --git a/packages/volto/src/components/manage/Blocks/Container/Edit.jsx b/packages/volto/src/components/manage/Blocks/Container/Edit.jsx
index df72ef7228..6c7fa892cb 100644
--- a/packages/volto/src/components/manage/Blocks/Container/Edit.jsx
+++ b/packages/volto/src/components/manage/Blocks/Container/Edit.jsx
@@ -1,7 +1,8 @@
import { useState } from 'react';
import { useIntl } from 'react-intl';
import { pickBy } from 'lodash';
-import { BlocksForm, SidebarPortal } from '@plone/volto/components';
+import { SidebarPortal } from '@plone/volto/components';
+import { BlocksForm } from '@plone/volto/components/manage/Form';
import PropTypes from 'prop-types';
import ContainerData from './Data';
import DefaultEditBlockWrapper from './EditBlockWrapper';
diff --git a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx
index 2df5c64190..94a43e1d3c 100644
--- a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx
+++ b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
import { Segment, Button } from 'semantic-ui-react';
import { useIntl, FormattedMessage, defineMessages } from 'react-intl';
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';
-import { BlockDataForm, Icon, Image } from '@plone/volto/components';
+import { Icon, Image } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { ImageSchema } from './schema';
import imageSVG from '@plone/volto/icons/image.svg';
import trashSVG from '@plone/volto/icons/delete.svg';
diff --git a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.test.jsx b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.test.jsx
index bc070b1d89..725237aff8 100644
--- a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.test.jsx
+++ b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.test.jsx
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
import ImageSidebar from './ImageSidebar';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
test('renders an Image Block Sidebar component', () => {
diff --git a/packages/volto/src/components/manage/Blocks/Image/__snapshots__/ImageSidebar.test.jsx.snap b/packages/volto/src/components/manage/Blocks/Image/__snapshots__/ImageSidebar.test.jsx.snap
index e4e4544a01..ebfafbc06e 100644
--- a/packages/volto/src/components/manage/Blocks/Image/__snapshots__/ImageSidebar.test.jsx.snap
+++ b/packages/volto/src/components/manage/Blocks/Image/__snapshots__/ImageSidebar.test.jsx.snap
@@ -58,125 +58,57 @@ Array [
/>
,
,
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"alt\\",
+ \\"align\\",
+ \\"size\\"
+ ]
+ },
+ {
+ \\"id\\": \\"link_settings\\",
+ \\"title\\": \\"Link settings\\",
+ \\"fields\\": [
+ \\"href\\",
+ \\"openLinkInNewTab\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"alt\\": {
+ \\"title\\": \\"Alt text\\"
+ },
+ \\"align\\": {
+ \\"title\\": \\"Alignment\\",
+ \\"widget\\": \\"align\\"
+ },
+ \\"size\\": {
+ \\"title\\": \\"Image size\\",
+ \\"widget\\": \\"image_size\\"
+ },
+ \\"href\\": {
+ \\"title\\": \\"Link to\\",
+ \\"widget\\": \\"object_browser\\",
+ \\"mode\\": \\"link\\",
+ \\"selectedItemAttrs\\": [
+ \\"Title\\",
+ \\"Description\\",
+ \\"hasPreviewImage\\"
+ ],
+ \\"allowExternals\\": true
+ },
+ \\"openLinkInNewTab\\": {
+ \\"title\\": \\"Open in a new tab\\",
+ \\"type\\": \\"boolean\\"
+ }
+ },
+ \\"required\\": []
+}"
+ id="BlockDataForm"
+ />,
]
`;
diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx
index 8998fc1be1..5a126ec2cc 100644
--- a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx
+++ b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx
@@ -3,12 +3,11 @@ import PropTypes from 'prop-types';
import { Form } from 'semantic-ui-react';
import { Accordion, Grid, Segment } from 'semantic-ui-react';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
+import { Icon, Image } from '@plone/volto/components';
import {
CheckboxWidget,
- Icon,
- Image,
TextWidget,
-} from '@plone/volto/components';
+} from '@plone/volto/components/manage/Widgets';
import { flattenToAppURL } from '@plone/volto/helpers';
import AlignBlock from '@plone/volto/components/manage/Sidebar/AlignBlock';
diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx
index a606afff4e..6eb8e5e98e 100644
--- a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx
+++ b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
import LeadImageSidebar from './LeadImageSidebar';
+jest.mock('@plone/volto/components/manage/Widgets');
+
const mockStore = configureStore();
test('renders a Lead Image block Sidebar component', () => {
diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/__snapshots__/LeadImageSidebar.test.jsx.snap b/packages/volto/src/components/manage/Blocks/LeadImage/__snapshots__/LeadImageSidebar.test.jsx.snap
index 92ec28dabf..07e5ee1607 100644
--- a/packages/volto/src/components/manage/Blocks/LeadImage/__snapshots__/LeadImageSidebar.test.jsx.snap
+++ b/packages/volto/src/components/manage/Blocks/LeadImage/__snapshots__/LeadImageSidebar.test.jsx.snap
@@ -29,84 +29,8 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
className="ui segment form sidebar-image-data"
>
+ id="TextWidget"
+ />
@@ -284,125 +208,11 @@ exports[`renders a Lead Image block Sidebar component 1`] = `
className="content active"
>
+ id="TextWidget"
+ />
-
-
-
-
-
-
-
- Open in a new tab
-
-
-
-
-
-
-
+ id="CheckboxWidget"
+ />
diff --git a/packages/volto/src/components/manage/Blocks/Listing/ListingData.jsx b/packages/volto/src/components/manage/Blocks/Listing/ListingData.jsx
index 64d68b1ec9..a531009b3f 100644
--- a/packages/volto/src/components/manage/Blocks/Listing/ListingData.jsx
+++ b/packages/volto/src/components/manage/Blocks/Listing/ListingData.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
-import { BlockDataForm } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
const ListingData = (props) => {
const { data, block, blocksConfig, onChangeBlock, navRoot, contentType } =
diff --git a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx
index 7762375087..1bc2179f0b 100644
--- a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx
+++ b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx
@@ -1,9 +1,9 @@
import React from 'react';
import { MapsSchema } from './schema';
-import { BlockDataForm } from '@plone/volto/components';
import { useIntl, defineMessages } from 'react-intl';
import globeSVG from '@plone/volto/icons/globe.svg';
import { Icon } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { Segment } from 'semantic-ui-react';
const messages = defineMessages({
diff --git a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx
index 16f5b7b829..6823f5c3d5 100644
--- a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx
+++ b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
import MapsSidebar from './MapsSidebar';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
test('renders an Image Block Sidebar component', () => {
diff --git a/packages/volto/src/components/manage/Blocks/Maps/__snapshots__/MapsSidebar.test.jsx.snap b/packages/volto/src/components/manage/Blocks/Maps/__snapshots__/MapsSidebar.test.jsx.snap
index df6185bc4e..fe58961939 100644
--- a/packages/volto/src/components/manage/Blocks/Maps/__snapshots__/MapsSidebar.test.jsx.snap
+++ b/packages/volto/src/components/manage/Blocks/Maps/__snapshots__/MapsSidebar.test.jsx.snap
@@ -2,46 +2,35 @@
exports[`renders an Image Block Sidebar component 1`] = `
+ data-schema="{
+ \\"title\\": \\"Maps\\",
+ \\"block\\": \\"Maps\\",
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"url\\",
+ \\"title\\",
+ \\"align\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"url\\": {
+ \\"title\\": \\"Maps URL\\",
+ \\"widget\\": \\"url\\"
+ },
+ \\"title\\": {
+ \\"title\\": \\"Alt text\\"
+ },
+ \\"align\\": {
+ \\"title\\": \\"Alignment\\",
+ \\"widget\\": \\"align\\"
+ }
+ },
+ \\"required\\": []
+}"
+ id="BlockDataForm"
+/>
`;
diff --git a/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx b/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx
index 2fbe1ce4c0..184ee3579b 100644
--- a/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx
+++ b/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx
@@ -2,7 +2,8 @@ import React, { useEffect } from 'react';
import { defineMessages } from 'react-intl';
import { compose } from 'redux';
-import { SidebarPortal, BlockDataForm } from '@plone/volto/components';
+import { SidebarPortal } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { addExtensionFieldToSchema } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer';
import { getBaseUrl } from '@plone/volto/helpers';
import config from '@plone/volto/registry';
diff --git a/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx b/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx
index 1d9f8e80d6..79b1feadef 100644
--- a/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx
+++ b/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
import { compose } from 'redux';
-import { FormFieldWrapper } from '@plone/volto/components';
+import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
import withQueryString from './../hocs/withQueryString';
import { defineMessages } from 'react-intl';
diff --git a/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx b/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx
index 713480d9c9..dace245b5d 100644
--- a/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx
+++ b/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx
@@ -1,7 +1,8 @@
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { Button } from 'semantic-ui-react';
-import { BlockDataForm, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import { isEmpty } from 'lodash';
import trashSVG from '@plone/volto/icons/delete.svg';
diff --git a/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx b/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx
index 08c1cf75f3..d9c68c6ca4 100644
--- a/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx
+++ b/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SidebarPortal } from '@plone/volto/components';
-import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import TableOfContentsSchema from './Schema';
import View from './View';
diff --git a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx
index 41ef60ea22..1a5b110f44 100644
--- a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx
+++ b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx
@@ -1,9 +1,9 @@
import React from 'react';
import { VideoBlockSchema } from './schema';
-import { BlockDataForm } from '@plone/volto/components';
import { Segment } from 'semantic-ui-react';
import { defineMessages, useIntl } from 'react-intl';
import { Icon } from '@plone/volto/components';
+import { BlockDataForm } from '@plone/volto/components/manage/Form';
import videoSVG from '@plone/volto/icons/videocamera.svg';
const messages = defineMessages({
diff --git a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.test.jsx b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.test.jsx
index ecfabadd68..d40ff249fc 100644
--- a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.test.jsx
+++ b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.test.jsx
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
import VideoSidebar from './VideoSidebar';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
test('renders an Image Block Sidebar component', () => {
diff --git a/packages/volto/src/components/manage/Blocks/Video/__snapshots__/VideoSidebar.test.jsx.snap b/packages/volto/src/components/manage/Blocks/Video/__snapshots__/VideoSidebar.test.jsx.snap
index e8bb34c7d6..2c5dec104c 100644
--- a/packages/volto/src/components/manage/Blocks/Video/__snapshots__/VideoSidebar.test.jsx.snap
+++ b/packages/volto/src/components/manage/Blocks/Video/__snapshots__/VideoSidebar.test.jsx.snap
@@ -2,46 +2,36 @@
exports[`renders an Image Block Sidebar component 1`] = `
+ data-schema="{
+ \\"title\\": \\"Video\\",
+ \\"block\\": \\"Video\\",
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"url\\",
+ \\"preview_image\\",
+ \\"align\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"url\\": {
+ \\"title\\": \\"Video URL\\",
+ \\"widget\\": \\"url\\"
+ },
+ \\"preview_image\\": {
+ \\"title\\": \\"Preview Image URL\\",
+ \\"widget\\": \\"url\\"
+ },
+ \\"align\\": {
+ \\"title\\": \\"Alignment\\",
+ \\"widget\\": \\"align\\"
+ }
+ },
+ \\"required\\": []
+}"
+ id="BlockDataForm"
+/>
`;
diff --git a/packages/volto/src/components/manage/Contents/Contents.jsx b/packages/volto/src/components/manage/Contents/Contents.jsx
index 94959669fd..b1fcf2aa0c 100644
--- a/packages/volto/src/components/manage/Contents/Contents.jsx
+++ b/packages/volto/src/components/manage/Contents/Contents.jsx
@@ -53,14 +53,6 @@ import {
} from '@plone/volto/actions';
import Indexes, { defaultIndexes } from '@plone/volto/constants/Indexes';
import {
- ContentsBreadcrumbs,
- ContentsIndexHeader,
- ContentsItem,
- ContentsRenameModal,
- ContentsUploadModal,
- ContentsWorkflowModal,
- ContentsTagsModal,
- ContentsPropertiesModal,
Pagination,
Popup,
Toolbar,
@@ -68,6 +60,14 @@ import {
Icon,
Unauthorized,
} from '@plone/volto/components';
+import ContentsBreadcrumbs from '@plone/volto/components/manage/Contents/ContentsBreadcrumbs';
+import ContentsIndexHeader from '@plone/volto/components/manage/Contents/ContentsIndexHeader';
+import ContentsItem from '@plone/volto/components/manage/Contents/ContentsItem';
+import { ContentsRenameModal } from '@plone/volto/components/manage/Contents';
+import ContentsUploadModal from '@plone/volto/components/manage/Contents/ContentsUploadModal';
+import ContentsWorkflowModal from '@plone/volto/components/manage/Contents/ContentsWorkflowModal';
+import ContentsTagsModal from '@plone/volto/components/manage/Contents/ContentsTagsModal';
+import ContentsPropertiesModal from '@plone/volto/components/manage/Contents/ContentsPropertiesModal';
import { Helmet, getBaseUrl } from '@plone/volto/helpers';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
diff --git a/packages/volto/src/components/manage/Contents/ContentsIndexHeader.test.jsx b/packages/volto/src/components/manage/Contents/ContentsIndexHeader.test.jsx
index 6cd1d5b4b8..ab06a45da6 100644
--- a/packages/volto/src/components/manage/Contents/ContentsIndexHeader.test.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsIndexHeader.test.jsx
@@ -4,7 +4,7 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { Provider } from 'react-intl-redux';
-import { ContentsIndexHeader } from '@plone/volto/components';
+import ContentsIndexHeader from './ContentsIndexHeader';
const mockStore = configureStore([thunk]);
diff --git a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx
index 2c7d3a3b28..6179502a79 100644
--- a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx
@@ -6,7 +6,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { usePrevious } from '@plone/volto/helpers';
import { updateContent } from '@plone/volto/actions';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
properties: {
diff --git a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.test.jsx b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.test.jsx
index 126e695026..f143096a37 100644
--- a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.test.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.test.jsx
@@ -7,7 +7,7 @@ import ContentsPropertiesModal from './ContentsPropertiesModal';
const mockStore = configureStore();
-jest.mock('../Form/ModalForm', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('ContentsPropertiesModal', () => {
it('renders a contents properties modal component', () => {
diff --git a/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx b/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx
index dde32df8f0..0719e13263 100644
--- a/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx
@@ -6,7 +6,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { usePrevious } from '@plone/volto/helpers';
import { updateContent } from '@plone/volto/actions';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
renameItems: {
diff --git a/packages/volto/src/components/manage/Contents/ContentsRenameModal.test.jsx b/packages/volto/src/components/manage/Contents/ContentsRenameModal.test.jsx
index c93de8f872..7d63a3aa86 100644
--- a/packages/volto/src/components/manage/Contents/ContentsRenameModal.test.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsRenameModal.test.jsx
@@ -7,7 +7,7 @@ import ContentsRenameModal from './ContentsRenameModal';
const mockStore = configureStore();
-jest.mock('../Form/ModalForm', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('ContentsRenameModal', () => {
it('renders a contents rename modal component', () => {
diff --git a/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx b/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx
index 042c5ec5b0..bc594a8dac 100644
--- a/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx
@@ -6,7 +6,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { usePrevious } from '@plone/volto/helpers';
import { updateContent } from '@plone/volto/actions';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
default: {
diff --git a/packages/volto/src/components/manage/Contents/ContentsTagsModal.test.jsx b/packages/volto/src/components/manage/Contents/ContentsTagsModal.test.jsx
index 9d368a3160..976155a8a9 100644
--- a/packages/volto/src/components/manage/Contents/ContentsTagsModal.test.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsTagsModal.test.jsx
@@ -7,7 +7,7 @@ import ContentsTagsModal from './ContentsTagsModal';
const mockStore = configureStore();
-jest.mock('../Form/ModalForm', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('ContentsTagsModal', () => {
it('renders a contents tags modal component', () => {
diff --git a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx
index d5ac0ba2cd..2f2b6fafe7 100644
--- a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx
@@ -6,7 +6,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { usePrevious } from '@plone/volto/helpers';
import { getWorkflow, transitionWorkflow } from '@plone/volto/actions';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
default: {
diff --git a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.test.jsx b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.test.jsx
index 68a90aff16..696107bd8a 100644
--- a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.test.jsx
+++ b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.test.jsx
@@ -7,7 +7,7 @@ import ContentsWorkflowModal from './ContentsWorkflowModal';
const mockStore = configureStore();
-jest.mock('../Form/ModalForm', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('ContentsWorkflowModal', () => {
it('renders a contents workflow modal component', () => {
diff --git a/packages/volto/src/components/manage/Contents/__mocks__/index.tsx b/packages/volto/src/components/manage/Contents/__mocks__/index.tsx
new file mode 100644
index 0000000000..6187049d16
--- /dev/null
+++ b/packages/volto/src/components/manage/Contents/__mocks__/index.tsx
@@ -0,0 +1,5 @@
+export const Contents = jest.fn(() =>
);
+
+export const ContentsRenameModal = jest.fn(() => (
+
+));
diff --git a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsPropertiesModal.test.jsx.snap b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsPropertiesModal.test.jsx.snap
index c460a95329..94d1ada1f8 100644
--- a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsPropertiesModal.test.jsx.snap
+++ b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsPropertiesModal.test.jsx.snap
@@ -3,7 +3,53 @@
exports[`ContentsPropertiesModal renders a contents properties modal component 1`] = `
`;
diff --git a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsRenameModal.test.jsx.snap b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsRenameModal.test.jsx.snap
index 991517203f..8398312a17 100644
--- a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsRenameModal.test.jsx.snap
+++ b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsRenameModal.test.jsx.snap
@@ -2,6 +2,31 @@
exports[`ContentsRenameModal renders a contents rename modal component 1`] = `
`;
diff --git a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsTagsModal.test.jsx.snap b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsTagsModal.test.jsx.snap
index 17c6d0619b..b39ee1a3a4 100644
--- a/packages/volto/src/components/manage/Contents/__snapshots__/ContentsTagsModal.test.jsx.snap
+++ b/packages/volto/src/components/manage/Contents/__snapshots__/ContentsTagsModal.test.jsx.snap
@@ -2,6 +2,37 @@
exports[`ContentsTagsModal renders a contents tags modal component 1`] = `
`;
diff --git a/packages/volto/src/components/manage/Contents/index.tsx b/packages/volto/src/components/manage/Contents/index.tsx
new file mode 100644
index 0000000000..f3df663cd2
--- /dev/null
+++ b/packages/volto/src/components/manage/Contents/index.tsx
@@ -0,0 +1,64 @@
+import loadable from '@loadable/component';
+
+export const Contents = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/Contents'
+ ),
+);
+
+export const ContentsRenameModal = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsRenameModal'
+ ),
+);
+
+export const ContentsBreadcrumbs = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsBreadcrumbs'
+ ),
+);
+
+export const ContentsIndexHeader = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsIndexHeader'
+ ),
+);
+
+export const ContentsItem = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsItem'
+ ),
+);
+
+export const ContentsUploadModal = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsUploadModal'
+ ),
+);
+
+export const ContentsPropertiesModal = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsPropertiesModal'
+ ),
+);
+
+export const ContentsWorkflowModal = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsWorkflowModal'
+ ),
+);
+
+export const ContentsTagsModal = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Contents" */ '@plone/volto/components/manage/Contents/ContentsTagsModal'
+ ),
+);
diff --git a/packages/volto/src/components/manage/Controlpanels/Aliases.jsx b/packages/volto/src/components/manage/Controlpanels/Aliases.jsx
index 6b985ea3d3..c5b80bed90 100644
--- a/packages/volto/src/components/manage/Controlpanels/Aliases.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Aliases.jsx
@@ -26,7 +26,7 @@ import {
Menu,
} from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
-import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget';
+import { DatetimeWidget } from '@plone/volto/components/manage/Widgets';
import { Icon, Toolbar } from '@plone/volto/components';
import backSVG from '@plone/volto/icons/back.svg';
diff --git a/packages/volto/src/components/manage/Controlpanels/Aliases.test.jsx b/packages/volto/src/components/manage/Controlpanels/Aliases.test.jsx
index c6a9a18010..6669a71eae 100644
--- a/packages/volto/src/components/manage/Controlpanels/Aliases.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Aliases.test.jsx
@@ -10,6 +10,7 @@ import { MemoryRouter } from 'react-router';
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
+jest.mock('@plone/volto/components/manage/Widgets');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
describe('Aliases', () => {
diff --git a/packages/volto/src/components/manage/Controlpanels/ContentType.jsx b/packages/volto/src/components/manage/Controlpanels/ContentType.jsx
index 6b8edbb9e6..531389e5f1 100644
--- a/packages/volto/src/components/manage/Controlpanels/ContentType.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ContentType.jsx
@@ -13,7 +13,8 @@ import { Button, Header } from 'semantic-ui-react';
import { defineMessages, injectIntl } from 'react-intl';
import { toast } from 'react-toastify';
import { last, nth, join } from 'lodash';
-import { Error, Form, Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Error, Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { getControlpanel, updateControlpanel } from '@plone/volto/actions';
import saveSVG from '@plone/volto/icons/save.svg';
diff --git a/packages/volto/src/components/manage/Controlpanels/ContentType.test.jsx b/packages/volto/src/components/manage/Controlpanels/ContentType.test.jsx
index 159c303936..7354f44ec9 100644
--- a/packages/volto/src/components/manage/Controlpanels/ContentType.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ContentType.test.jsx
@@ -8,8 +8,8 @@ import ContentType from './ContentType';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
-jest.mock('../Form/Form', () => jest.fn(() =>
));
describe('ContentType', () => {
it('renders dexterity content-type component', () => {
diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx
index 3e5cd1a388..7135562957 100644
--- a/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx
@@ -19,14 +19,8 @@ import { Button, Segment } from 'semantic-ui-react';
import { toast } from 'react-toastify';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { nth, join } from 'lodash';
-import {
- Error,
- Form,
- Icon,
- Toolbar,
- Sidebar,
- Toast,
-} from '@plone/volto/components';
+import { Error, Icon, Toolbar, Sidebar, Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import {
getSchema,
updateSchema,
diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx
index ab6888140b..6aaeeff4ab 100644
--- a/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx
@@ -6,7 +6,8 @@
import { getSchema, putSchema } from '@plone/volto/actions';
import { getParentUrl } from '@plone/volto/helpers';
import { nth } from 'lodash';
-import { Error, Form, Icon, Toast, Toolbar } from '@plone/volto/components';
+import { Error, Icon, Toast, Toolbar } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import clearSVG from '@plone/volto/icons/clear.svg';
import saveSVG from '@plone/volto/icons/save.svg';
import PropTypes from 'prop-types';
diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx
index 4759ed6fb2..45a8846ac1 100644
--- a/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx
@@ -14,14 +14,8 @@ import { last } from 'lodash';
import { Confirm, Container, Table, Button, Header } from 'semantic-ui-react';
import { toast } from 'react-toastify';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
-import {
- Error,
- Icon,
- ModalForm,
- Toolbar,
- Toast,
- ContentTypesActions,
-} from '@plone/volto/components';
+import { Error, Icon, Toolbar, Toast } from '@plone/volto/components';
+import ContentTypesActions from '@plone/volto/components/manage/Controlpanels/ContentTypesActions';
import {
getControlpanel,
postControlpanel,
@@ -31,6 +25,7 @@ import { getId } from '@plone/volto/helpers';
import addSVG from '@plone/volto/icons/add-document.svg';
import backSVG from '@plone/volto/icons/back.svg';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
add: {
diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx
index a55477d787..a88acc3ae0 100644
--- a/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx
@@ -14,7 +14,8 @@ import { Button, Container } from 'semantic-ui-react';
import { defineMessages, injectIntl } from 'react-intl';
import { toast } from 'react-toastify';
-import { Form, Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { updateControlpanel, getControlpanel } from '@plone/volto/actions';
import config from '@plone/volto/registry';
diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanel.test.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanel.test.jsx
index 1ee6a98c11..e935aa3a21 100644
--- a/packages/volto/src/components/manage/Controlpanels/Controlpanel.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Controlpanel.test.jsx
@@ -8,10 +8,9 @@ import Controlpanel from './Controlpanel';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
-jest.mock('../Form/Form', () => jest.fn(() =>
));
-
describe('Controlpanel', () => {
it('renders a controlpanel component', () => {
const store = mockStore({
diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx
index d2751c0142..e5622d8d25 100644
--- a/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx
@@ -3,18 +3,15 @@
* @module components/manage/Controlpanels/Controlpanels
*/
-import { Helmet, asyncConnect } from '@plone/volto/helpers';
+import { Helmet } from '@plone/volto/helpers';
import { concat, filter, last, map, sortBy, uniqBy } from 'lodash';
-import PropTypes from 'prop-types';
import { useEffect, useState } from 'react';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import { createPortal } from 'react-dom';
-import { connect } from 'react-redux';
+import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
-import { compose } from 'redux';
import { Container, Grid, Header, Message, Segment } from 'semantic-ui-react';
-import { getSystemInformation, listControlpanels } from '@plone/volto/actions';
import { Error, Icon, Toolbar, VersionOverview } from '@plone/volto/components';
import config from '@plone/volto/registry';
@@ -99,15 +96,19 @@ const messages = defineMessages({
/**
* Controlpanels container class.
*/
-function Controlpanels({
- controlpanels,
- controlpanelsRequest,
- systemInformation,
- pathname,
-}) {
+export default function Controlpanels({ location }) {
const intl = useIntl();
const [isClient, setIsClient] = useState(false);
+ const { pathname } = location;
+ const controlpanels = useSelector(
+ (state) => state.controlpanels.controlpanels,
+ );
+ const controlpanelsRequest = useSelector((state) => state.controlpanels.list);
+ const systemInformation = useSelector(
+ (state) => state.controlpanels.systeminformation,
+ );
+
useEffect(() => {
setIsClient(true);
}, []);
@@ -281,41 +282,3 @@ function Controlpanels({
);
}
-
-/**
- * Property types.
- * @property {Object} propTypes Property types.
- * @static
- */
-Controlpanels.propTypes = {
- controlpanels: PropTypes.arrayOf(
- PropTypes.shape({
- '@id': PropTypes.string,
- group: PropTypes.string,
- title: PropTypes.string,
- }),
- ).isRequired,
- pathname: PropTypes.string.isRequired,
-};
-
-export default compose(
- connect((state, props) => ({
- controlpanels: state.controlpanels.controlpanels,
- controlpanelsRequest: state.controlpanels.list,
- pathname: props.location.pathname,
- systemInformation: state.controlpanels.systeminformation,
- })),
-
- asyncConnect([
- {
- key: 'controlpanels',
- promise: async ({ location, store: { dispatch } }) =>
- await dispatch(listControlpanels()),
- },
- {
- key: 'systemInformation',
- promise: async ({ location, store: { dispatch } }) =>
- await dispatch(getSystemInformation()),
- },
- ]),
-)(Controlpanels);
diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanels.test.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanels.test.jsx
index 10ce403043..7455537323 100644
--- a/packages/volto/src/components/manage/Controlpanels/Controlpanels.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Controlpanels.test.jsx
@@ -11,35 +11,37 @@ const mockStore = configureStore();
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
-jest.mock('./VersionOverview', () =>
- jest.fn(() =>
),
-);
+jest.mock('@plone/volto/components/manage/Controlpanels', () => ({
+ VersionOverview: jest.fn(() =>
),
+}));
describe('Controlpanels', () => {
it('renders a controlpanels component', () => {
const store = mockStore({
- controlpanels: [
- {
- '@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
- group: 'General',
- title: 'Date and Time',
- },
- {
- '@id': 'http://localhost:8080/Plone/@controlpanels/lang',
- group: 'General',
- title: 'Language',
- },
- {
- '@id': 'http://localhost:8080/Plone/@controlpanels/editing',
- group: 'Content',
- title: 'Editing',
- },
- {
- '@id': 'http://localhost:8080/Plone/@controlpanels/security',
- group: 'Security',
- title: 'test',
- },
- ],
+ controlpanels: {
+ controlpanels: [
+ {
+ '@id': 'http://localhost:8080/Plone/@controlpanels/date-and-time',
+ group: 'General',
+ title: 'Date and Time',
+ },
+ {
+ '@id': 'http://localhost:8080/Plone/@controlpanels/lang',
+ group: 'General',
+ title: 'Language',
+ },
+ {
+ '@id': 'http://localhost:8080/Plone/@controlpanels/editing',
+ group: 'Content',
+ title: 'Editing',
+ },
+ {
+ '@id': 'http://localhost:8080/Plone/@controlpanels/security',
+ group: 'Security',
+ title: 'test',
+ },
+ ],
+ },
reduxAsyncConnect: {
// Mocked in redux async connect as it isn't fetch client-side.
controlpanels: [
@@ -85,13 +87,15 @@ describe('Controlpanels', () => {
it('renders an additional control panel', () => {
const store = mockStore({
- controlpanels: [
- {
- '@id': 'http://localhost:8080/Plone/@controlpanels/security',
- group: 'Security',
- title: 'test',
- },
- ],
+ controlpanels: {
+ controlpanels: [
+ {
+ '@id': 'http://localhost:8080/Plone/@controlpanels/security',
+ group: 'Security',
+ title: 'test',
+ },
+ ],
+ },
reduxAsyncConnect: {
// Mocked in redux async connect as it isn't fetch client-side.
controlpanels: [
diff --git a/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx
index 97fcb5cb27..61ba77f182 100644
--- a/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx
@@ -15,13 +15,13 @@ import {
import jwtDecode from 'jwt-decode';
import {
Icon,
- ModalForm,
Toast,
Toolbar,
- RenderGroups,
Pagination,
Error,
} from '@plone/volto/components';
+import RenderGroups from '@plone/volto/components/manage/Controlpanels/Groups/RenderGroups';
+import { ModalForm } from '@plone/volto/components/manage/Form';
import { Link } from 'react-router-dom';
import {
Helmet,
diff --git a/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx b/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx
index d5036a50d2..b2e35eb089 100644
--- a/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx
@@ -14,12 +14,8 @@ import { Container, Button, Table } from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { deleteComment, searchContent } from '@plone/volto/actions';
-import {
- CommentEditModal,
- FormattedRelativeDate,
- Icon,
- Toolbar,
-} from '@plone/volto/components';
+import { FormattedRelativeDate, Icon, Toolbar } from '@plone/volto/components';
+import { CommentEditModal } from '@plone/volto/components/theme/Comments';
import backSVG from '@plone/volto/icons/back.svg';
diff --git a/packages/volto/src/components/manage/Controlpanels/ModerateComments.test.jsx b/packages/volto/src/components/manage/Controlpanels/ModerateComments.test.jsx
index d5c79af439..1535137582 100644
--- a/packages/volto/src/components/manage/Controlpanels/ModerateComments.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/ModerateComments.test.jsx
@@ -7,12 +7,9 @@ import ModerateComments from './ModerateComments';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/theme/Comments');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
-jest.mock('../../theme/Comments/CommentEditModal', () =>
- jest.fn(() =>
),
-);
-
describe('ModerateComments', () => {
it('renders a moderate comments component', () => {
const store = mockStore({
diff --git a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx
index 1dae5ff0cc..b79ade4571 100644
--- a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx
@@ -15,7 +15,7 @@ import {
searchContent,
} from '@plone/volto/actions';
-const ListingTemplate = ({
+const RelationsListing = ({
relationtype,
query_source,
query_target,
@@ -477,4 +477,4 @@ const ListingTemplate = ({
>
);
};
-export default ListingTemplate;
+export default RelationsListing;
diff --git a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx
index e6b09998f6..b4b4a10ac1 100644
--- a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx
@@ -22,8 +22,8 @@ import {
queryRelations,
rebuildRelations,
} from '@plone/volto/actions';
-import RelationsListing from './RelationsListing';
-import BrokenRelations from './BrokenRelations';
+import RelationsListing from '@plone/volto/components/manage/Controlpanels/Relations/RelationsListing';
+import BrokenRelations from '@plone/volto/components/manage/Controlpanels/Relations/BrokenRelations';
import helpSVG from '@plone/volto/icons/help.svg';
import clearSVG from '@plone/volto/icons/clear.svg';
import navTreeSVG from '@plone/volto/icons/nav.svg';
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx
index 85aba340be..8a6fe6818e 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx
@@ -19,9 +19,9 @@ import {
Segment,
} from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
-import { Icon, Toolbar, Field } from '@plone/volto/components';
+import { Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Field } from '@plone/volto/components/manage/Form';
import { toast } from 'react-toastify';
-import { Toast } from '@plone/volto/components';
import { getContentRulesEvents, addNewRule } from '@plone/volto/actions';
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.test.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.test.jsx
index 5f83ebaef8..d99d0acd3a 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.test.jsx
@@ -9,6 +9,7 @@ import AddRule from './AddRule';
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../../Toolbar/Toolbar', () => jest.fn(() =>
));
describe('AddRule', () => {
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx
index b8cd8a9124..0021ae6f78 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx
@@ -20,14 +20,14 @@ import {
} from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
-import { Icon, Toolbar, Field } from '@plone/volto/components';
+import { Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Field } from '@plone/volto/components/manage/Form';
import {
getControlPanelRule,
editRule,
getContentRulesEvents,
} from '@plone/volto/actions';
import { toast } from 'react-toastify';
-import { Toast } from '@plone/volto/components';
import backSVG from '@plone/volto/icons/back.svg';
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.test.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.test.jsx
index 100aa9a64b..d7ad95e19d 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.test.jsx
@@ -11,6 +11,8 @@ const mockStore = configureMockStore(middlewares);
jest.mock('../../Toolbar/Toolbar', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
+
describe('EditRule', () => {
it('renders rules edit interface', () => {
const store = mockStore({
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/AddRule.test.jsx.snap b/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/AddRule.test.jsx.snap
index b85d427f10..ab499ca1d9 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/AddRule.test.jsx.snap
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/AddRule.test.jsx.snap
@@ -40,12 +40,9 @@ exports[`AddRule renders rules add interface 1`] = `
class="column"
>
Title
- -
- Please set a descriptive title for the rule.
@@ -56,12 +53,9 @@ exports[`AddRule renders rules add interface 1`] = `
class="column"
>
Description
- -
- Enter a short description of the rule and its purpose.
@@ -72,12 +66,9 @@ exports[`AddRule renders rules add interface 1`] = `
class="column"
>
Triggering event
- -
- The rule will execute when the following event occurs.
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/EditRule.test.jsx.snap b/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/EditRule.test.jsx.snap
index 931b391418..5e55ca65e5 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/EditRule.test.jsx.snap
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/__snapshots__/EditRule.test.jsx.snap
@@ -40,12 +40,9 @@ exports[`EditRule renders rules edit interface 1`] = `
class="column"
>
Title
- -
- Please set a descriptive title for the rule.
@@ -56,12 +53,9 @@ exports[`EditRule renders rules edit interface 1`] = `
class="column"
>
Description
- -
- Enter a short description of the rule and its purpose.
@@ -72,12 +66,9 @@ exports[`EditRule renders rules edit interface 1`] = `
class="column"
>
Triggering event
- -
- The rule will execute when the following event occurs.
diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx
index 53a65d5a38..20c31454f8 100644
--- a/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx
@@ -6,7 +6,7 @@ import { getVocabulary } from '@plone/volto/actions';
import { injectIntl } from 'react-intl';
import { compose } from 'redux';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const setSchema = (name, choices = '') => {
switch (name) {
diff --git a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx
index 3b95e2dd4a..7b754df390 100644
--- a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx
@@ -10,7 +10,8 @@ import { Link } from 'react-router-dom';
import { createPortal } from 'react-dom';
import { Container, Segment, Table, Menu, Input } from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
-import { Icon, Toolbar, Form, Toast } from '@plone/volto/components';
+import { Icon, Toolbar, Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import backSVG from '@plone/volto/icons/back.svg';
import { map } from 'lodash';
import { Helmet } from '@plone/volto/helpers';
diff --git a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.test.jsx b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.test.jsx
index ba7261c78e..2cf42b0364 100644
--- a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.test.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.test.jsx
@@ -7,10 +7,9 @@ import UndoControlpanel from './UndoControlpanel';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
-jest.mock('../Form/Form', () => jest.fn(() =>
));
-
describe('UndoControlpanel', () => {
it('renders undo controlpanel component', () => {
const store = mockStore({
diff --git a/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx b/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx
index fe1efd6c55..d616d4fad9 100644
--- a/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx
@@ -25,7 +25,8 @@ import {
runUpgrade,
} from '@plone/volto/actions';
import { Helmet } from '@plone/volto/helpers';
-import { Icon, Toast, Toolbar, VersionOverview } from '@plone/volto/components';
+import { Icon, Toast, Toolbar } from '@plone/volto/components';
+import { VersionOverview } from '@plone/volto/components/manage/Controlpanels';
import backSVG from '@plone/volto/icons/back.svg';
import { toast } from 'react-toastify';
diff --git a/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx b/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx
index ec50363eac..9b9ca1ca63 100644
--- a/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx
@@ -8,7 +8,8 @@ import { FormattedMessage, injectIntl } from 'react-intl';
import { Dropdown, Table, Checkbox } from 'semantic-ui-react';
import trashSVG from '@plone/volto/icons/delete.svg';
import editSVG from '@plone/volto/icons/editing.svg';
-import { Icon, ModalForm, Toast } from '@plone/volto/components';
+import { Icon, Toast } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
import { updateUser } from '@plone/volto/actions';
import ploneSVG from '@plone/volto/icons/plone.svg';
import { compose } from 'redux';
diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx
index 6e784c0c06..ca41f24f4f 100644
--- a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx
@@ -7,7 +7,7 @@ import { isEqual } from 'lodash';
import { messages } from '@plone/volto/helpers';
import { listGroups } from '@plone/volto/actions'; // getRegistry
-import UserGroupMembershipListing from './UserGroupMembershipListing';
+import UserGroupMembershipListing from '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipListing';
const UserGroupMembershipMatrix = ({ many_users, many_groups }) => {
const intl = useIntl();
diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx
index 1547dceb4a..9bd27a252c 100644
--- a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx
+++ b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx
@@ -17,13 +17,13 @@ import {
import jwtDecode from 'jwt-decode';
import {
Icon,
- ModalForm,
Toast,
Toolbar,
- RenderUsers,
Pagination,
Error,
} from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
+import RenderUsers from '@plone/volto/components/manage/Controlpanels/Users/RenderUsers';
import { Link } from 'react-router-dom';
import {
Helmet,
diff --git a/packages/volto/src/components/manage/Controlpanels/__snapshots__/Aliases.test.jsx.snap b/packages/volto/src/components/manage/Controlpanels/__snapshots__/Aliases.test.jsx.snap
index 79e00ac7e7..2a16d8f8f2 100644
--- a/packages/volto/src/components/manage/Controlpanels/__snapshots__/Aliases.test.jsx.snap
+++ b/packages/volto/src/components/manage/Controlpanels/__snapshots__/Aliases.test.jsx.snap
@@ -180,7 +180,11 @@ exports[`Aliases renders an aliases control component 1`] = `
+ >
+
+
diff --git a/packages/volto/src/components/manage/Controlpanels/__snapshots__/ContentType.test.jsx.snap b/packages/volto/src/components/manage/Controlpanels/__snapshots__/ContentType.test.jsx.snap
index 4f14e1a276..1303a5bb04 100644
--- a/packages/volto/src/components/manage/Controlpanels/__snapshots__/ContentType.test.jsx.snap
+++ b/packages/volto/src/components/manage/Controlpanels/__snapshots__/ContentType.test.jsx.snap
@@ -12,7 +12,8 @@ exports[`ContentType renders dexterity content-type component 1`] = `
Page Content Type
diff --git a/packages/volto/src/components/manage/Controlpanels/__snapshots__/UndoControlpanel.test.jsx.snap b/packages/volto/src/components/manage/Controlpanels/__snapshots__/UndoControlpanel.test.jsx.snap
index 44d370a5b8..dc7569f0bb 100644
--- a/packages/volto/src/components/manage/Controlpanels/__snapshots__/UndoControlpanel.test.jsx.snap
+++ b/packages/volto/src/components/manage/Controlpanels/__snapshots__/UndoControlpanel.test.jsx.snap
@@ -18,7 +18,52 @@ exports[`UndoControlpanel renders undo controlpanel component 1`] = `
class="ui segment"
>
+ import(
+ /* webpackChunkName: "Controlpanels" */ '@plone/volto/components/manage/Controlpanels/Controlpanels'
+ ),
+);
+
+export const Controlpanels = asyncConnect([
+ {
+ key: 'controlpanels',
+ promise: async ({ store: { dispatch } }: any) =>
+ await dispatch(listControlpanels()),
+ },
+ {
+ key: 'systemInformation',
+ promise: async ({ store: { dispatch } }: any) =>
+ await dispatch(getSystemInformation()),
+ },
+])(LoadableControlpanels);
+
+export const Controlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Controlpanels" */ '@plone/volto/components/manage/Controlpanels/Controlpanel'
+ ),
+);
+
+// RULES CONTROLPANELS
+
+export const RulesControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "RulesControlpanel" */ '@plone/volto/components/manage/Controlpanels/Rules/Rules'
+ ),
+);
+
+export const AddRuleControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "RulesControlpanel" */ '@plone/volto/components/manage/Controlpanels/Rules/AddRule'
+ ),
+);
+
+export const EditRuleControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "RulesControlpanel" */ '@plone/volto/components/manage/Controlpanels/Rules/EditRule'
+ ),
+);
+
+export const ConfigureRuleControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "RulesControlpanel" */ '@plone/volto/components/manage/Controlpanels/Rules/ConfigureRule'
+ ),
+);
+
+// USERS CONTROLPANELS
+
+export const UsersControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "UsersControlpanel" */ '@plone/volto/components/manage/Controlpanels/Users/UsersControlpanel'
+ ),
+);
+
+export const RenderUsers = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "UsersControlpanel" */ '@plone/volto/components/manage/Controlpanels/Users/RenderUsers'
+ ),
+);
+
+export const UserGroupMembershipControlPanel = loadable(
+ () =>
+ import(
+ '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel'
+ ),
+);
+
+export const GroupsControlpanel = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "GroupsControlpanel" */ '@plone/volto/components/manage/Controlpanels/Groups/GroupsControlpanel'
+ ),
+);
+
+export const RenderGroups = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "GroupsControlpanel" */ '@plone/volto/components/manage/Controlpanels/Groups/RenderGroups'
+ ),
+);
+
+// RELATIONS CONTROLPANEL
+
+export const RelationsControlpanel = loadable(
+ () =>
+ import('@plone/volto/components/manage/Controlpanels/Relations/Relations'),
+);
+
+// ALIASES CONTROLPANEL
+
+export const AliasesControlpanel = loadable(
+ () => import('@plone/volto/components/manage/Controlpanels/Aliases'),
+);
+
+// UNDO CONTROLPANEL
+
+export const UndoControlpanel = loadable(
+ () => import('@plone/volto/components/manage/Controlpanels/UndoControlpanel'),
+);
+
+// ADDONS CONTROLPANEL
+
+export const AddonsControlpanel = loadable(
+ () =>
+ import('@plone/volto/components/manage/Controlpanels/AddonsControlpanel'),
+);
+
+// CONTENT TYPES CONTROLPANEL
+
+export const ContentType = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "ContentTypesControlpanel" */ '@plone/volto/components/manage/Controlpanels/ContentType'
+ ),
+);
+
+export const ContentTypeLayout = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "ContentTypesControlpanel" */ '@plone/volto/components/manage/Controlpanels/ContentTypeLayout'
+ ),
+);
+
+export const ContentTypeSchema = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "ContentTypesControlpanel" */ '@plone/volto/components/manage/Controlpanels/ContentTypeSchema'
+ ),
+);
+
+export const ContentTypes = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "ContentTypesControlpanel" */ '@plone/volto/components/manage/Controlpanels/ContentTypes'
+ ),
+);
+
+// VERSION OVERVIEW
+
+export const VersionOverview = loadable(
+ () => import('@plone/volto/components/manage/Controlpanels/VersionOverview'),
+);
+
+// PLONE UPGRADES CONTROLPANELS
+
+export const UpgradeControlPanel = loadable(
+ () =>
+ import('@plone/volto/components/manage/Controlpanels/UpgradeControlPanel'),
+);
+
+// MODERATE COMMENTS CONTROLPANEL
+
+export const ModerateComments = loadable(
+ () => import('@plone/volto/components/manage/Controlpanels/ModerateComments'),
+);
+
+// DATABASE INFORMATION CONTROLPANELS
+
+export const DatabaseInformation = loadable(
+ () =>
+ import('@plone/volto/components/manage/Controlpanels/DatabaseInformation'),
+);
diff --git a/packages/volto/src/components/manage/Diff/Diff.jsx b/packages/volto/src/components/manage/Diff/Diff.jsx
index 6b5b1caf21..01ea0002ab 100644
--- a/packages/volto/src/components/manage/Diff/Diff.jsx
+++ b/packages/volto/src/components/manage/Diff/Diff.jsx
@@ -23,12 +23,12 @@ import {
hasBlocksData,
} from '@plone/volto/helpers';
import {
- DiffField,
FormattedDate,
Icon,
Toolbar,
Unauthorized,
} from '@plone/volto/components';
+import DiffField from '@plone/volto/components/manage/Diff/DiffField';
import backSVG from '@plone/volto/icons/back.svg';
diff --git a/packages/volto/src/components/manage/Display/Display.jsx b/packages/volto/src/components/manage/Display/Display.jsx
index 0680d84794..0544211b25 100644
--- a/packages/volto/src/components/manage/Display/Display.jsx
+++ b/packages/volto/src/components/manage/Display/Display.jsx
@@ -6,7 +6,8 @@ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
import { getSchema, updateContent, getContent } from '@plone/volto/actions';
import { getLayoutFieldname } from '@plone/volto/helpers';
-import { FormFieldWrapper, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
import { defineMessages, injectIntl } from 'react-intl';
import config from '@plone/volto/registry';
diff --git a/packages/volto/src/components/manage/Display/Display.test.jsx b/packages/volto/src/components/manage/Display/Display.test.jsx
index 8608ee8891..1ff6193cd5 100644
--- a/packages/volto/src/components/manage/Display/Display.test.jsx
+++ b/packages/volto/src/components/manage/Display/Display.test.jsx
@@ -8,6 +8,7 @@ import Display from './Display';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Widgets');
jest.mock('@plone/volto/helpers/Loadable/Loadable');
beforeAll(
async () =>
diff --git a/packages/volto/src/components/manage/Display/__snapshots__/Display.test.jsx.snap b/packages/volto/src/components/manage/Display/__snapshots__/Display.test.jsx.snap
index cac362d7e7..776404b320 100644
--- a/packages/volto/src/components/manage/Display/__snapshots__/Display.test.jsx.snap
+++ b/packages/volto/src/components/manage/Display/__snapshots__/Display.test.jsx.snap
@@ -5,88 +5,7 @@ exports[`Display renders a Display component empty in case that there is only on
exports[`Display renders a Display component with more than one option 1`] = `
+ id="FormFieldWrapper"
+ />
`;
diff --git a/packages/volto/src/components/manage/Edit/Edit.jsx b/packages/volto/src/components/manage/Edit/Edit.jsx
index 38e2c6474a..7be1fa906b 100644
--- a/packages/volto/src/components/manage/Edit/Edit.jsx
+++ b/packages/volto/src/components/manage/Edit/Edit.jsx
@@ -18,7 +18,6 @@ import { toast } from 'react-toastify';
import {
Forbidden,
- Form,
Icon,
Sidebar,
Toast,
@@ -27,6 +26,7 @@ import {
CompareLanguages,
TranslationObject,
} from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import {
updateContent,
getContent,
diff --git a/packages/volto/src/components/manage/Edit/Edit.test.jsx b/packages/volto/src/components/manage/Edit/Edit.test.jsx
index 28eff96b95..5ed58d1650 100644
--- a/packages/volto/src/components/manage/Edit/Edit.test.jsx
+++ b/packages/volto/src/components/manage/Edit/Edit.test.jsx
@@ -8,11 +8,10 @@ import { __test__ as Edit } from './Edit';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
jest.mock('../Sidebar/Sidebar', () => jest.fn(() => ));
-jest.mock('../Form/Form', () => jest.fn(() =>
));
-
describe('Edit', () => {
it('renders an empty edit component', () => {
const store = mockStore({
diff --git a/packages/volto/src/components/manage/Edit/__snapshots__/Edit.test.jsx.snap b/packages/volto/src/components/manage/Edit/__snapshots__/Edit.test.jsx.snap
index 67d8997fd5..aa41134ae8 100644
--- a/packages/volto/src/components/manage/Edit/__snapshots__/Edit.test.jsx.snap
+++ b/packages/volto/src/components/manage/Edit/__snapshots__/Edit.test.jsx.snap
@@ -13,7 +13,10 @@ exports[`Edit renders an edit component 1`] = `
id="page-edit"
>
jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('Form', () => {
it('renders a form component', () => {
diff --git a/packages/volto/src/components/manage/Form/InlineForm.jsx b/packages/volto/src/components/manage/Form/InlineForm.jsx
index dff1936913..40c2e51ab9 100644
--- a/packages/volto/src/components/manage/Form/InlineForm.jsx
+++ b/packages/volto/src/components/manage/Form/InlineForm.jsx
@@ -11,7 +11,8 @@ import {
removeFromArray,
arrayRange,
} from '@plone/volto/helpers/Utils/Utils';
-import { Field, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import { Field } from '@plone/volto/components/manage/Form';
import { applySchemaDefaults } from '@plone/volto/helpers';
import upSVG from '@plone/volto/icons/up-key.svg';
diff --git a/packages/volto/src/components/manage/Form/InlineForm.test.jsx b/packages/volto/src/components/manage/Form/InlineForm.test.jsx
index 1ab4b15248..173c15282a 100644
--- a/packages/volto/src/components/manage/Form/InlineForm.test.jsx
+++ b/packages/volto/src/components/manage/Form/InlineForm.test.jsx
@@ -6,6 +6,8 @@ import config from '@plone/volto/registry';
import InlineForm from './InlineForm';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
function NewBaseWidget(name) {
diff --git a/packages/volto/src/components/manage/Form/ModalForm.jsx b/packages/volto/src/components/manage/Form/ModalForm.jsx
index 2ab262688e..1bc9771f57 100644
--- a/packages/volto/src/components/manage/Form/ModalForm.jsx
+++ b/packages/volto/src/components/manage/Form/ModalForm.jsx
@@ -18,7 +18,8 @@ import {
} from 'semantic-ui-react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { FormValidation } from '@plone/volto/helpers';
-import { Field, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import { Field } from '@plone/volto/components/manage/Form';
import aheadSVG from '@plone/volto/icons/ahead.svg';
import clearSVG from '@plone/volto/icons/clear.svg';
diff --git a/packages/volto/src/components/manage/Form/ModalForm.test.jsx b/packages/volto/src/components/manage/Form/ModalForm.test.jsx
index f6eb4e368d..e70aea6724 100644
--- a/packages/volto/src/components/manage/Form/ModalForm.test.jsx
+++ b/packages/volto/src/components/manage/Form/ModalForm.test.jsx
@@ -8,7 +8,7 @@ import ModalForm from './ModalForm';
const mockStore = configureStore();
-jest.mock('./Field', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
describe('ModalForm', () => {
it('renders a modal form component', () => {
diff --git a/packages/volto/src/components/manage/Form/__mocks__/index.tsx b/packages/volto/src/components/manage/Form/__mocks__/index.tsx
new file mode 100644
index 0000000000..a77ae62741
--- /dev/null
+++ b/packages/volto/src/components/manage/Form/__mocks__/index.tsx
@@ -0,0 +1,74 @@
+import type { JSONSchema } from '@plone/types';
+import type { Ref } from 'react';
+const { forwardRef } = jest.requireActual('react');
+
+// Field descriptions can contain react elements and those are not JSON stringifiable
+const cleanupSchema = (schema: JSONSchema | null): JSONSchema | null => {
+ if (!schema || !schema.properties) return schema;
+ return {
+ ...schema,
+ properties: Object.entries(schema.properties).reduce
>(
+ (acc, [key, value]) => {
+ acc[key] = {
+ ...value,
+ description:
+ typeof value.description === 'string'
+ ? value.description
+ : undefined,
+ };
+ return acc;
+ },
+ {},
+ ),
+ };
+};
+
+export const Field = jest.fn((props) => (
+
+ {props.title}
+
+));
+
+export const InlineForm = jest.fn((props) => (
+
+));
+
+export const ModalForm = jest.fn((props) => (
+
+));
+
+export const UndoToolbar = jest.fn(() =>
);
+
+export const BlocksToolbar = jest.fn(() =>
);
+
+export const BlockDataForm = jest.fn((props) => (
+
+));
+
+export const BlocksForm = jest.fn((props) => (
+
+));
+
+const MockForm = forwardRef(
+ (props: { schema: JSONSchema | null }, ref: Ref) => (
+
+ ),
+);
+
+export const Form = jest.fn((props) => );
diff --git a/packages/volto/src/components/manage/Form/__snapshots__/BlockDataForm.test.jsx.snap b/packages/volto/src/components/manage/Form/__snapshots__/BlockDataForm.test.jsx.snap
index 3c9020a016..49b491c652 100644
--- a/packages/volto/src/components/manage/Form/__snapshots__/BlockDataForm.test.jsx.snap
+++ b/packages/volto/src/components/manage/Form/__snapshots__/BlockDataForm.test.jsx.snap
@@ -3,69 +3,93 @@
exports[`BlockDataForm should add variations to schema 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"title\\": \\"Default\\",
+ \\"id\\": \\"default\\",
+ \\"fields\\": [
+ \\"variation\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"variation\\": {
+ \\"title\\": \\"Variation\\",
+ \\"choices\\": [
+ [
+ \\"default\\",
+ \\"Default\\"
+ ],
+ [
+ \\"extra\\",
+ \\"Extra\\"
+ ]
+ ],
+ \\"noValueOption\\": false,
+ \\"default\\": \\"default\\"
+ }
+ },
+ \\"required\\": []
+}"
+ id="InlineForm"
+ />
`;
exports[`BlockDataForm should not add variations to schema when explicitly disabled 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"title\\": \\"Default\\",
+ \\"id\\": \\"default\\",
+ \\"fields\\": []
+ }
+ ],
+ \\"properties\\": {},
+ \\"required\\": []
+}"
+ id="InlineForm"
+ />
`;
exports[`BlockDataForm should not add variations to schema when unneeded 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"title\\": \\"Default\\",
+ \\"id\\": \\"default\\",
+ \\"fields\\": []
+ }
+ ],
+ \\"properties\\": {},
+ \\"required\\": []
+}"
+ id="InlineForm"
+ />
`;
exports[`BlockDataForm should not add variations when only one variation 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"title\\": \\"Default\\",
+ \\"id\\": \\"default\\",
+ \\"fields\\": []
+ }
+ ],
+ \\"properties\\": {},
+ \\"required\\": []
+}"
+ id="InlineForm"
+ />
`;
diff --git a/packages/volto/src/components/manage/Form/__snapshots__/Form.test.jsx.snap b/packages/volto/src/components/manage/Form/__snapshots__/Form.test.jsx.snap
index 1cf0e7b027..2ac50e9818 100644
--- a/packages/volto/src/components/manage/Form/__snapshots__/Form.test.jsx.snap
+++ b/packages/volto/src/components/manage/Form/__snapshots__/Form.test.jsx.snap
@@ -20,6 +20,7 @@ exports[`Form renders a form component 1`] = `
>
@@ -39,34 +35,22 @@ exports[`Form renders a form component with defaults in the schema - Checkboxes
class="ui segment form attached"
>
The checkbox
- -
- No description
- -
- No value
The truthy checkbox
- -
- No description
- -
- true
The falsy checkbox
- -
- No description
- -
- false
@@ -86,14 +70,10 @@ exports[`Form renders a form component with defaults in the schema - Default tex
class="ui segment form attached"
>
The title
- -
- No description
- -
- This is the default
@@ -113,24 +93,16 @@ exports[`Form renders a form component with defaults in the schema - Number fiel
class="ui segment form attached"
>
The number, default set
- -
- No description
- -
- 5
The number, default with a value
- -
- No description
- -
- 10
diff --git a/packages/volto/src/components/manage/Form/index.tsx b/packages/volto/src/components/manage/Form/index.tsx
new file mode 100644
index 0000000000..d784862389
--- /dev/null
+++ b/packages/volto/src/components/manage/Form/index.tsx
@@ -0,0 +1,50 @@
+import loadable from '@loadable/component';
+
+export const Field = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/Field'
+ ),
+);
+export const InlineForm = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/InlineForm'
+ ),
+);
+export const ModalForm = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/ModalForm'
+ ),
+);
+export const UndoToolbar = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/UndoToolbar'
+ ),
+);
+export const BlocksToolbar = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/BlocksToolbar'
+ ),
+);
+export const BlockDataForm = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/BlockDataForm'
+ ),
+);
+export const BlocksForm = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Blocks/Block/BlocksForm'
+ ),
+);
+export const Form = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Form" */ '@plone/volto/components/manage/Form/Form'
+ ),
+);
diff --git a/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx b/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx
index 10df7079dc..706507b878 100644
--- a/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx
+++ b/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx
@@ -3,7 +3,7 @@ import { map } from 'lodash';
import { defineMessages, useIntl } from 'react-intl';
import { Form as UiForm, Menu, Segment } from 'semantic-ui-react';
import { Provider } from 'react-intl-redux';
-import { Form, Field } from '@plone/volto/components';
+import { Form, Field } from '@plone/volto/components/manage/Form';
import config from '@plone/volto/registry';
import configureStore from '@plone/volto/store';
import {
@@ -14,6 +14,7 @@ import {
toReactIntlLang,
} from '@plone/volto/helpers';
import { createBrowserHistory } from 'history';
+
const messages = defineMessages({
document: {
id: 'Document',
diff --git a/packages/volto/src/components/manage/Preferences/ChangePassword.jsx b/packages/volto/src/components/manage/Preferences/ChangePassword.jsx
index b686ca0c9f..994a6aa632 100644
--- a/packages/volto/src/components/manage/Preferences/ChangePassword.jsx
+++ b/packages/volto/src/components/manage/Preferences/ChangePassword.jsx
@@ -15,7 +15,8 @@ import { Container } from 'semantic-ui-react';
import jwtDecode from 'jwt-decode';
import { toast } from 'react-toastify';
-import { Form, Icon, Toast, Toolbar } from '@plone/volto/components';
+import { Icon, Toast, Toolbar } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { updatePassword } from '@plone/volto/actions';
import { getBaseUrl } from '@plone/volto/helpers';
diff --git a/packages/volto/src/components/manage/Preferences/ChangePassword.test.jsx b/packages/volto/src/components/manage/Preferences/ChangePassword.test.jsx
index 7746c796f2..6e865ae765 100644
--- a/packages/volto/src/components/manage/Preferences/ChangePassword.test.jsx
+++ b/packages/volto/src/components/manage/Preferences/ChangePassword.test.jsx
@@ -9,6 +9,7 @@ import ChangePassword from './ChangePassword';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
describe('ChangePassword', () => {
diff --git a/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx b/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx
index b222d5b59e..a32233014b 100644
--- a/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx
+++ b/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx
@@ -12,7 +12,8 @@ import { withRouter } from 'react-router-dom';
import jwtDecode from 'jwt-decode';
import { toast } from 'react-toastify';
import { messages } from '@plone/volto/helpers';
-import { Form, Toast } from '@plone/volto/components';
+import { Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { getUser, updateUser, getUserSchema } from '@plone/volto/actions';
/**
diff --git a/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx b/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx
index cae87d2a04..605da71837 100644
--- a/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx
+++ b/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx
@@ -12,7 +12,8 @@ import { withCookies } from 'react-cookie';
import { defineMessages, injectIntl } from 'react-intl';
import { toast } from 'react-toastify';
-import { Form, Toast } from '@plone/volto/components';
+import { Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import languages from '@plone/volto/constants/Languages';
import { changeLanguage } from '@plone/volto/actions';
import { toGettextLang } from '@plone/volto/helpers';
diff --git a/packages/volto/src/components/manage/Preferences/PersonalPreferences.test.jsx b/packages/volto/src/components/manage/Preferences/PersonalPreferences.test.jsx
index 8a72fe0d9f..009c2595c4 100644
--- a/packages/volto/src/components/manage/Preferences/PersonalPreferences.test.jsx
+++ b/packages/volto/src/components/manage/Preferences/PersonalPreferences.test.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import { Provider } from 'react-intl-redux';
import configureStore from 'redux-mock-store';
import { MemoryRouter } from 'react-router-dom';
-import { waitFor, render, screen } from '@testing-library/react';
+import { render } from '@testing-library/react';
import PersonalPreferences from './PersonalPreferences';
@@ -10,6 +10,7 @@ const mockStore = configureStore();
jest.mock('../Toolbar/Toolbar', () => jest.fn(() =>
));
+jest.mock('@plone/volto/components/manage/Form');
jest.mock('@plone/volto/helpers/Loadable/Loadable');
beforeAll(
async () =>
@@ -17,7 +18,7 @@ beforeAll(
);
describe('PersonalPreferences', () => {
- it('renders a personal preferences component', async () => {
+ it('renders a personal preferences component', () => {
const store = mockStore({
intl: {
locale: 'en',
@@ -47,9 +48,6 @@ describe('PersonalPreferences', () => {
,
);
- await waitFor(() => {
- screen.getByTitle('Cancel');
- });
expect(container).toMatchSnapshot();
});
});
diff --git a/packages/volto/src/components/manage/Preferences/__snapshots__/ChangePassword.test.jsx.snap b/packages/volto/src/components/manage/Preferences/__snapshots__/ChangePassword.test.jsx.snap
index 1dbacb73fa..7fd5e2166a 100644
--- a/packages/volto/src/components/manage/Preferences/__snapshots__/ChangePassword.test.jsx.snap
+++ b/packages/volto/src/components/manage/Preferences/__snapshots__/ChangePassword.test.jsx.snap
@@ -7,79 +7,46 @@ exports[`ChangePassword renders a change password component 1`] = `
id="page-change-password"
>
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"oldPassword\\",
+ \\"newPassword\\",
+ \\"newPasswordRepeat\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"oldPassword\\": {
+ \\"description\\": \\"Enter your current password.\\",
+ \\"title\\": \\"Current password\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"password\\"
+ },
+ \\"newPassword\\": {
+ \\"description\\": \\"Enter your new password. Minimum 8 characters.\\",
+ \\"title\\": \\"New password\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"password\\"
+ },
+ \\"newPasswordRepeat\\": {
+ \\"description\\": \\"Re-enter the password. Make sure the passwords are identical.\\",
+ \\"title\\": \\"Confirm password\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"password\\"
+ }
+ },
+ \\"required\\": [
+ \\"oldPassword\\",
+ \\"newPassword\\",
+ \\"newPasswordRepeat\\"
+ ]
+}"
+ id="Form"
+ />
`;
diff --git a/packages/volto/src/components/manage/Rules/index.tsx b/packages/volto/src/components/manage/Rules/index.tsx
new file mode 100644
index 0000000000..1db608da66
--- /dev/null
+++ b/packages/volto/src/components/manage/Rules/index.tsx
@@ -0,0 +1,5 @@
+import loadable from '@loadable/component';
+
+export const Rules = loadable(
+ () => import('@plone/volto/components/manage/Rules/Rules'),
+);
diff --git a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx
index c66f7d237a..bc2131ddaf 100644
--- a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx
@@ -30,7 +30,7 @@ import {
MultiValueContainer,
} from '@plone/volto/components/manage/Widgets/SelectStyling';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
const messages = defineMessages({
select: {
diff --git a/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx b/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx
index f54e1ef991..6b9b940e69 100644
--- a/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { Icon } from '@plone/volto/components';
import { Button } from 'semantic-ui-react';
diff --git a/packages/volto/src/components/manage/Widgets/CheckboxWidget.jsx b/packages/volto/src/components/manage/Widgets/CheckboxWidget.jsx
index b787a2557b..aeefdaf6d2 100644
--- a/packages/volto/src/components/manage/Widgets/CheckboxWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/CheckboxWidget.jsx
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
import { Checkbox } from 'semantic-ui-react';
import { injectIntl } from 'react-intl';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
/**
* CheckboxWidget component class.
diff --git a/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx b/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx
index 7c783b8a30..546f57e22a 100644
--- a/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx
@@ -9,7 +9,8 @@ import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import loadable from '@loadable/component';
import cx from 'classnames';
-import { Icon, FormFieldWrapper } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { parseDateTime, toBackendLang } from '@plone/volto/helpers';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
diff --git a/packages/volto/src/components/manage/Widgets/EmailWidget.jsx b/packages/volto/src/components/manage/Widgets/EmailWidget.jsx
index 1455c75314..cd26034b05 100644
--- a/packages/volto/src/components/manage/Widgets/EmailWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/EmailWidget.jsx
@@ -3,7 +3,7 @@
* @module components/manage/Widgets/EmailWidget
*/
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import PropTypes from 'prop-types';
import React from 'react';
import { Input } from 'semantic-ui-react';
diff --git a/packages/volto/src/components/manage/Widgets/FileWidget.jsx b/packages/volto/src/components/manage/Widgets/FileWidget.jsx
index e35b015cad..112ac04647 100644
--- a/packages/volto/src/components/manage/Widgets/FileWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/FileWidget.jsx
@@ -9,7 +9,8 @@ import { Button, Image, Dimmer } from 'semantic-ui-react';
import { readAsDataURL } from 'promise-file-reader';
import { injectIntl } from 'react-intl';
import deleteSVG from '@plone/volto/icons/delete.svg';
-import { Icon, FormFieldWrapper, UniversalLink } from '@plone/volto/components';
+import { Icon, UniversalLink } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import loadable from '@loadable/component';
import { flattenToAppURL, validateFileUploadSize } from '@plone/volto/helpers';
import { defineMessages, useIntl } from 'react-intl';
diff --git a/packages/volto/src/components/manage/Widgets/IdWidget.jsx b/packages/volto/src/components/manage/Widgets/IdWidget.jsx
index 005f51e0fb..ffab20baf2 100644
--- a/packages/volto/src/components/manage/Widgets/IdWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/IdWidget.jsx
@@ -11,7 +11,8 @@ import { Input } from 'semantic-ui-react';
import { compact, concat, keys, map, union, uniq } from 'lodash';
import { defineMessages, injectIntl } from 'react-intl';
-import { Icon, FormFieldWrapper } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import config from '@plone/volto/registry';
import { getQuerystring } from '@plone/volto/actions';
diff --git a/packages/volto/src/components/manage/Widgets/ImageSizeWidget.jsx b/packages/volto/src/components/manage/Widgets/ImageSizeWidget.jsx
index 32e7b396c0..eba009c7c5 100644
--- a/packages/volto/src/components/manage/Widgets/ImageSizeWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ImageSizeWidget.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { Button, Grid } from 'semantic-ui-react';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
const messages = defineMessages({
small: {
diff --git a/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx b/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx
index a3e6f360e1..6f65f8566a 100644
--- a/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx
@@ -4,10 +4,10 @@
*/
import React, { useState } from 'react';
-import { compose } from 'redux';
import PropTypes from 'prop-types';
import { Input, Button } from 'semantic-ui-react';
-import { FormFieldWrapper, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { isInternalURL, flattenToAppURL, URLUtils } from '@plone/volto/helpers';
import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
import clearSVG from '@plone/volto/icons/clear.svg';
@@ -177,4 +177,4 @@ InternalUrlWidget.defaultProps = {
maxLength: null,
};
-export default compose(withObjectBrowser)(InternalUrlWidget);
+export default withObjectBrowser(InternalUrlWidget);
diff --git a/packages/volto/src/components/manage/Widgets/NumberWidget.jsx b/packages/volto/src/components/manage/Widgets/NumberWidget.jsx
index 98b25b70ba..b598765ce2 100644
--- a/packages/volto/src/components/manage/Widgets/NumberWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/NumberWidget.jsx
@@ -6,7 +6,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Input } from 'semantic-ui-react';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { injectIntl } from 'react-intl';
/**
diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx b/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx
index 859d5915bf..2cc78da16e 100644
--- a/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx
@@ -1,7 +1,8 @@
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { Accordion, Button, Segment } from 'semantic-ui-react';
-import { DragDropList, FormFieldWrapper, Icon } from '@plone/volto/components';
+import { DragDropList, Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { applySchemaDefaults, reorderArray } from '@plone/volto/helpers';
import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js b/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js
index 8332bf129d..4f9c91d74e 100644
--- a/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js
+++ b/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js
@@ -5,6 +5,8 @@ import configureStore from 'redux-mock-store';
import ObjectListWidget from './ObjectListWidget';
jest.mock('@plone/volto/helpers/Loadable/Loadable');
+jest.mock('@plone/volto/components/manage/Form');
+
beforeAll(
async () =>
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
diff --git a/packages/volto/src/components/manage/Widgets/ObjectWidget.jsx b/packages/volto/src/components/manage/Widgets/ObjectWidget.jsx
index 2228416805..9d9960afcb 100644
--- a/packages/volto/src/components/manage/Widgets/ObjectWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ObjectWidget.jsx
@@ -6,8 +6,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Tab } from 'semantic-ui-react';
-
-import Field from '@plone/volto/components/manage/Form/Field';
+import { Field } from '@plone/volto/components/manage/Form';
/**
* Renders a field set. Passes some of the values in the schema to the Field
diff --git a/packages/volto/src/components/manage/Widgets/ObjectWidget.test.jsx b/packages/volto/src/components/manage/Widgets/ObjectWidget.test.jsx
index 6f0d2d9e22..6db8c228fa 100644
--- a/packages/volto/src/components/manage/Widgets/ObjectWidget.test.jsx
+++ b/packages/volto/src/components/manage/Widgets/ObjectWidget.test.jsx
@@ -5,6 +5,8 @@ import { Provider } from 'react-intl-redux';
import { render, fireEvent } from '@testing-library/react';
import ObjectWidget from './ObjectWidget';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
const LinkSchema = {
diff --git a/packages/volto/src/components/manage/Widgets/PasswordWidget.jsx b/packages/volto/src/components/manage/Widgets/PasswordWidget.jsx
index 233d33e883..a0e2e76d05 100644
--- a/packages/volto/src/components/manage/Widgets/PasswordWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/PasswordWidget.jsx
@@ -6,7 +6,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Input } from 'semantic-ui-react';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { injectIntl } from 'react-intl';
/**
diff --git a/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx b/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx
index 95e44e59e1..7255b88aba 100644
--- a/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { toPairs, groupBy, map } from 'lodash';
import { defineMessages, useIntl } from 'react-intl';
import { useSelector } from 'react-redux';
diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx
index 53d776b81f..43163b55c9 100644
--- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx
@@ -6,7 +6,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { compose } from 'redux';
-//import { RRule, RRuleSet, rrulestr } from 'rrule';
import { connect } from 'react-redux';
import cx from 'classnames';
@@ -22,7 +21,9 @@ import {
Header,
} from 'semantic-ui-react';
-import { SelectWidget, Icon, DatetimeWidget } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget';
+import SelectWidget from '@plone/volto/components/manage/Widgets/SelectWidget';
import { toBackendLang } from '@plone/volto/helpers';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx
index 5142db10c3..a3165c2280 100644
--- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx
+++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx
@@ -5,7 +5,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-import Select from 'react-select';
import { find } from 'lodash';
import {
Option,
@@ -13,12 +12,22 @@ import {
selectTheme,
customSelectStyles,
} from '@plone/volto/components/manage/Widgets/SelectStyling';
+import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
+
/**
* SelectInput component class.
* @function SelectInput
* @returns {string} Markup of the component.
*/
-const SelectInput = ({ name, disabled, options, value, onChange }) => {
+const SelectInput = ({
+ name,
+ disabled,
+ options,
+ value,
+ onChange,
+ reactSelect,
+}) => {
+ const Select = reactSelect.default;
const inlineSelectStyles = {
...customSelectStyles,
control: (styles, state) => ({
@@ -78,4 +87,4 @@ SelectInput.defaultProps = {
onChange: null,
};
-export default SelectInput;
+export default injectLazyLibs('reactSelect')(SelectInput);
diff --git a/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx b/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx
index 4b4b402a8b..8ab70c31b5 100644
--- a/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx
@@ -11,7 +11,7 @@ import { Label, Dropdown, Popup, Icon } from 'semantic-ui-react';
import { compact, concat, fromPairs, map, values, uniqBy } from 'lodash';
import { defineMessages, injectIntl } from 'react-intl';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { resetSearchContent, searchContent } from '@plone/volto/actions';
import { flattenToAppURL } from '@plone/volto/helpers';
diff --git a/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx b/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx
index 4045d66ab3..b33aebac0c 100644
--- a/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx
@@ -9,7 +9,8 @@ import { Button, Image, Dimmer } from 'semantic-ui-react';
import { readAsDataURL } from 'promise-file-reader';
import { injectIntl } from 'react-intl';
import deleteSVG from '@plone/volto/icons/delete.svg';
-import { Icon, FormFieldWrapper } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import loadable from '@loadable/component';
import { defineMessages, useIntl } from 'react-intl';
import { toPublicURL, validateFileUploadSize } from '@plone/volto/helpers';
diff --git a/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx b/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx
index 45accd6775..0bf9c45d91 100644
--- a/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx
@@ -14,11 +14,8 @@ import { defineMessages, injectIntl } from 'react-intl';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
import { slugify } from '@plone/volto/helpers/Utils/Utils';
-import {
- Field,
- ModalForm,
- SchemaWidgetFieldset,
-} from '@plone/volto/components';
+import SchemaWidgetFieldset from '@plone/volto/components/manage/Widgets/SchemaWidgetFieldset';
+import { Field, ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
add: {
diff --git a/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx b/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx
index 5f76fee3b7..a90f643b06 100644
--- a/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx
+++ b/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx
@@ -32,7 +32,7 @@ import {
MenuList,
} from '@plone/volto/components/manage/Widgets/SelectStyling';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
const messages = defineMessages({
select: {
diff --git a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx
index 182879130b..64b0cdea69 100644
--- a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx
@@ -14,7 +14,7 @@ import {
getVocabFromField,
getVocabFromItems,
} from '@plone/volto/helpers';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { getVocabulary, getVocabularyTokenTitle } from '@plone/volto/actions';
import { normalizeValue } from '@plone/volto/components/manage/Widgets/SelectUtils';
diff --git a/packages/volto/src/components/manage/Widgets/TextWidget.jsx b/packages/volto/src/components/manage/Widgets/TextWidget.jsx
index e39f7a0051..fe53ed89b1 100644
--- a/packages/volto/src/components/manage/Widgets/TextWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/TextWidget.jsx
@@ -8,7 +8,8 @@ import PropTypes from 'prop-types';
import { Input } from 'semantic-ui-react';
import { injectIntl } from 'react-intl';
-import { Icon, FormFieldWrapper } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
/**
* The simple text widget.
diff --git a/packages/volto/src/components/manage/Widgets/TextareaWidget.jsx b/packages/volto/src/components/manage/Widgets/TextareaWidget.jsx
index 4116c28fcf..bfb9aa2195 100644
--- a/packages/volto/src/components/manage/Widgets/TextareaWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/TextareaWidget.jsx
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
import { Label, TextArea } from 'semantic-ui-react';
import { injectIntl } from 'react-intl';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
/**
* TextareaWidget, a widget for multiple lines text
diff --git a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx
index 13cd304e33..b38de6897d 100644
--- a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx
@@ -24,7 +24,7 @@ import {
customSelectStyles,
} from '@plone/volto/components/manage/Widgets/SelectStyling';
-import { FormFieldWrapper } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
const messages = defineMessages({
diff --git a/packages/volto/src/components/manage/Widgets/UrlWidget.jsx b/packages/volto/src/components/manage/Widgets/UrlWidget.jsx
index 4ec2867635..60e7b348bc 100644
--- a/packages/volto/src/components/manage/Widgets/UrlWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/UrlWidget.jsx
@@ -4,10 +4,10 @@
*/
import React, { useState } from 'react';
-import { compose } from 'redux';
import PropTypes from 'prop-types';
import { Input, Button } from 'semantic-ui-react';
-import { FormFieldWrapper, Icon } from '@plone/volto/components';
+import { Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
import {
addAppURL,
isInternalURL,
@@ -182,4 +182,4 @@ UrlWidget.defaultProps = {
maxLength: null,
};
-export default compose(withObjectBrowser)(UrlWidget);
+export default withObjectBrowser(UrlWidget);
diff --git a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx
index 797f977976..cfefd80a67 100644
--- a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx
+++ b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx
@@ -2,7 +2,7 @@
* VocabularyTermsWidget
* @module components/manage/Widgets/VocabularyTermsWidget
* Widget for plone.schema.JSONField field meant for a SimpleVocabulary source
- *
+ *
VOCABULARY_SCHEMA = json.dumps(
{
@@ -68,7 +68,7 @@ def TalkTypesVocabulary(context):
* titles are editable
* tokens are generated
- *
+ *
* Purpose: Use this widget for a controlpanel field
* that acts as a source of a vocabulary for a zope.schema.Choice field.
* Vocabulary terms should change over time only in title, not value,
@@ -90,12 +90,9 @@ import { v4 as uuid } from 'uuid';
import { Button } from 'semantic-ui-react';
-import {
- DragDropList,
- FormFieldWrapper,
- Icon,
- ObjectWidget,
-} from '@plone/volto/components';
+import { DragDropList, Icon } from '@plone/volto/components';
+import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
+import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
import { langmap } from '@plone/volto/helpers';
import deleteSVG from '@plone/volto/icons/delete.svg';
diff --git a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx
index 32e5ff4008..b0c59a1320 100644
--- a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx
+++ b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx
@@ -6,6 +6,8 @@ import { Provider } from 'react-intl-redux';
import VocabularyTermsWidget from './VocabularyTermsWidget';
jest.mock('@plone/volto/helpers/Loadable/Loadable');
+jest.mock('@plone/volto/components/manage/Form');
+
beforeAll(
async () =>
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
diff --git a/packages/volto/src/components/manage/Widgets/__mocks__/index.tsx b/packages/volto/src/components/manage/Widgets/__mocks__/index.tsx
new file mode 100644
index 0000000000..e5e77c0585
--- /dev/null
+++ b/packages/volto/src/components/manage/Widgets/__mocks__/index.tsx
@@ -0,0 +1,43 @@
+export const AlignWidget = jest.fn(() =>
);
+export const ButtonsWidget = jest.fn(() =>
);
+export const ArrayWidget = jest.fn(() =>
);
+export const CheckboxWidget = jest.fn(() =>
);
+export const FileWidget = jest.fn(() =>
);
+export const IdWidget = jest.fn(() =>
);
+export const PasswordWidget = jest.fn(() =>
);
+export const QueryWidget = jest.fn(() =>
);
+export const QuerySortOnWidget = jest.fn(() =>
);
+export const QuerystringWidget = jest.fn(() =>
);
+export const SchemaWidget = jest.fn(() =>
);
+export const SelectWidget = jest.fn(() =>
);
+export const TextareaWidget = jest.fn(() =>
);
+export const TextWidget = jest.fn(() =>
);
+export const TokenWidget = jest.fn(() =>
);
+export const WysiwygWidget = jest.fn(() =>
);
+export const UrlWidget = jest.fn(() =>
);
+export const InternalUrlWidget = jest.fn(() =>
);
+export const EmailWidget = jest.fn(() =>
);
+export const NumberWidget = jest.fn(() =>
);
+export const ImageSizeWidget = jest.fn(() =>
);
+export const RegistryImageWidget = jest.fn(() => (
+
+));
+export const ReferenceWidget = jest.fn(() =>
);
+export const ObjectBrowserWidget = jest.fn(() => (
+
+));
+export const ObjectWidget = jest.fn(() =>
);
+export const ObjectListWidget = jest.fn(() =>
);
+export const VocabularyTermsWidget = jest.fn(() => (
+
+));
+export const SelectMetadataWidget = jest.fn(() => (
+
+));
+export const SelectAutoComplete = jest.fn(() => (
+
+));
+export const ColorPickerWidget = jest.fn(() =>
);
+export const DatetimeWidget = jest.fn(() =>
);
+export const RecurrenceWidget = jest.fn(() =>
);
+export const FormFieldWrapper = jest.fn(() =>
);
diff --git a/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap b/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap
index 9fb5ad7833..e70caaea6a 100644
--- a/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap
+++ b/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap
@@ -176,10 +176,10 @@ exports[`renders an object list widget component 1`] = `
class="ui bottom attached segment active tab"
>
- Internal link - No description
+ Internal link
@@ -271,10 +271,10 @@ exports[`renders an object list widget component 1`] = `
class="ui bottom attached segment active tab"
>
- Internal link - No description
+ Internal link
diff --git a/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectWidget.test.jsx.snap b/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectWidget.test.jsx.snap
index 2537d5137c..4030f7b34d 100644
--- a/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectWidget.test.jsx.snap
+++ b/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectWidget.test.jsx.snap
@@ -26,10 +26,10 @@ exports[`renders an object widget component with clicks on each tab in root leve
class="ui bottom attached segment active tab"
>
- Internal link - No description
+ Internal link
@@ -62,10 +62,10 @@ exports[`renders an object widget component with clicks on each tab in root leve
class="ui bottom attached segment active tab"
>
- External URL (can be relative within this site or absolute if it starts with http:// or https://) - No description
+ External URL (can be relative within this site or absolute if it starts with http:// or https://)
@@ -98,16 +98,16 @@ exports[`renders an object widget component with clicks on each tab in root leve
class="ui bottom attached segment active tab"
>
- Email address - No description
+ Email address
- Email subject (optional) - No description
+ Email subject (optional)
@@ -142,12 +142,10 @@ exports[`renders an object widget component with invalid field in value 1`] = `
className="ui bottom attached segment active tab"
>
Internal link
- -
- No description
diff --git a/packages/volto/src/components/manage/Widgets/__snapshots__/VocabularyTermsWidget.test.jsx.snap b/packages/volto/src/components/manage/Widgets/__snapshots__/VocabularyTermsWidget.test.jsx.snap
index 1874373aa8..ecf1148dde 100644
--- a/packages/volto/src/components/manage/Widgets/__snapshots__/VocabularyTermsWidget.test.jsx.snap
+++ b/packages/volto/src/components/manage/Widgets/__snapshots__/VocabularyTermsWidget.test.jsx.snap
@@ -77,28 +77,22 @@ exports[`renders a dictionary widget component 1`] = `
class="ui drag block inner"
>
English
- -
- No description
Deutsch
- -
- No description
Italiano
- -
- No description
@@ -145,28 +139,22 @@ exports[`renders a dictionary widget component 1`] = `
class="ui drag block inner"
>
English
- -
- No description
Deutsch
- -
- No description
Italiano
- -
- No description
@@ -213,28 +201,22 @@ exports[`renders a dictionary widget component 1`] = `
class="ui drag block inner"
>
English
- -
- No description
Deutsch
- -
- No description
Italiano
- -
- No description
diff --git a/packages/volto/src/components/manage/Widgets/index.tsx b/packages/volto/src/components/manage/Widgets/index.tsx
new file mode 100644
index 0000000000..844847c602
--- /dev/null
+++ b/packages/volto/src/components/manage/Widgets/index.tsx
@@ -0,0 +1,232 @@
+import loadable from '@loadable/component';
+
+export const AlignWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/AlignWidget'
+ ),
+);
+
+export const ButtonsWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ButtonsWidget'
+ ),
+);
+
+export const ArrayWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ArrayWidget'
+ ),
+);
+
+export const CheckboxWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/CheckboxWidget'
+ ),
+);
+
+export const FileWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/FileWidget'
+ ),
+);
+
+export const IdWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/IdWidget'
+ ),
+);
+
+export const PasswordWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/PasswordWidget'
+ ),
+);
+
+export const QueryWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QueryWidget'
+ ),
+);
+
+export const QuerySortOnWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QuerySortOnWidget'
+ ),
+);
+
+export const QuerystringWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/QuerystringWidget'
+ ),
+);
+
+export const SchemaWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SchemaWidget'
+ ),
+);
+
+export const SelectWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SelectWidget'
+ ),
+);
+
+export const TextareaWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TextareaWidget'
+ ),
+);
+
+export const TextWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TextWidget'
+ ),
+);
+
+export const TokenWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/TokenWidget'
+ ),
+);
+
+export const WysiwygWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/WysiwygWidget'
+ ),
+);
+
+export const UrlWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/UrlWidget'
+ ),
+);
+
+export const InternalUrlWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/InternalUrlWidget'
+ ),
+);
+
+export const EmailWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/EmailWidget'
+ ),
+);
+
+export const NumberWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/NumberWidget'
+ ),
+);
+
+export const ImageSizeWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ImageSizeWidget'
+ ),
+);
+
+export const RegistryImageWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/RegistryImageWidget'
+ ),
+);
+
+export const ReferenceWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ReferenceWidget'
+ ),
+);
+
+export const ObjectBrowserWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectBrowserWidget'
+ ),
+);
+
+export const ObjectWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectWidget'
+ ),
+);
+
+export const ObjectListWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ObjectListWidget'
+ ),
+);
+
+export const VocabularyTermsWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/VocabularyTermsWidget'
+ ),
+);
+
+export const SelectMetadataWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Blocks/Search/widgets/SelectMetadataField'
+ ),
+);
+
+export const SelectAutoComplete = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/SelectAutoComplete'
+ ),
+);
+
+export const ColorPickerWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/ColorPickerWidget'
+ ),
+);
+
+export const DatetimeWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/DatetimeWidget'
+ ),
+);
+
+export const RecurrenceWidget = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
+ ),
+);
+
+export const FormFieldWrapper = loadable(
+ () =>
+ import(
+ /* webpackChunkName: "Widgets" */ '@plone/volto/components/manage/Widgets/FormFieldWrapper'
+ ),
+);
diff --git a/packages/volto/src/components/manage/Workflow/Workflow.jsx b/packages/volto/src/components/manage/Workflow/Workflow.jsx
index 44f2d0dc3a..7185af3b58 100644
--- a/packages/volto/src/components/manage/Workflow/Workflow.jsx
+++ b/packages/volto/src/components/manage/Workflow/Workflow.jsx
@@ -6,7 +6,8 @@ import { uniqBy } from 'lodash';
import { toast } from 'react-toastify';
import { defineMessages, useIntl } from 'react-intl';
-import { FormFieldWrapper, Icon, Toast } from '@plone/volto/components';
+import { Icon, Toast } from '@plone/volto/components';
+import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets';
import {
flattenToAppURL,
getWorkflowOptions,
diff --git a/packages/volto/src/components/manage/Workflow/Workflow.test.jsx b/packages/volto/src/components/manage/Workflow/Workflow.test.jsx
index e95d6dfe51..0470c5cfba 100644
--- a/packages/volto/src/components/manage/Workflow/Workflow.test.jsx
+++ b/packages/volto/src/components/manage/Workflow/Workflow.test.jsx
@@ -1,13 +1,14 @@
import React from 'react';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
-import { waitFor, render, screen } from '@testing-library/react';
+import { render } from '@testing-library/react';
import config from '@plone/volto/registry';
import Workflow from './Workflow';
const mockStore = configureStore();
+jest.mock('@plone/volto/components/manage/Widgets');
jest.mock('@plone/volto/helpers/Loadable/Loadable');
beforeAll(
async () =>
@@ -46,7 +47,6 @@ describe('Workflow', () => {
,
);
- await waitFor(() => screen.getByText(/Published/));
expect(container).toMatchSnapshot();
});
@@ -70,7 +70,6 @@ describe('Workflow', () => {
,
);
- await waitFor(() => screen.getByText('Private'));
expect(container).toMatchSnapshot();
});
});
diff --git a/packages/volto/src/components/manage/Workflow/__snapshots__/Workflow.test.jsx.snap b/packages/volto/src/components/manage/Workflow/__snapshots__/Workflow.test.jsx.snap
index f688149c83..3b4897246e 100644
--- a/packages/volto/src/components/manage/Workflow/__snapshots__/Workflow.test.jsx.snap
+++ b/packages/volto/src/components/manage/Workflow/__snapshots__/Workflow.test.jsx.snap
@@ -3,179 +3,15 @@
exports[`Workflow renders a workflow component 1`] = `
+ id="FormFieldWrapper"
+ />
`;
exports[`Workflow renders an empty workflow component 1`] = `
+ id="FormFieldWrapper"
+ />
`;
diff --git a/packages/volto/src/components/theme/Comments/CommentEditModal.jsx b/packages/volto/src/components/theme/Comments/CommentEditModal.jsx
index 0a4873d54a..3400ec83d2 100644
--- a/packages/volto/src/components/theme/Comments/CommentEditModal.jsx
+++ b/packages/volto/src/components/theme/Comments/CommentEditModal.jsx
@@ -5,7 +5,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { usePrevious } from '@plone/volto/helpers';
import { updateComment } from '@plone/volto/actions';
-import { ModalForm } from '@plone/volto/components';
+import { ModalForm } from '@plone/volto/components/manage/Form';
const messages = defineMessages({
editComment: {
diff --git a/packages/volto/src/components/theme/Comments/CommentEditModal.test.jsx b/packages/volto/src/components/theme/Comments/CommentEditModal.test.jsx
index 3dd3b12538..334ff63457 100644
--- a/packages/volto/src/components/theme/Comments/CommentEditModal.test.jsx
+++ b/packages/volto/src/components/theme/Comments/CommentEditModal.test.jsx
@@ -7,9 +7,7 @@ import CommentEditModal from './CommentEditModal';
const mockStore = configureStore();
-jest.mock('../../manage/Form/ModalForm', () =>
- jest.fn(() =>
),
-);
+jest.mock('@plone/volto/components/manage/Form');
describe('CommentEditModal', () => {
it('renders a comment edit modal component', () => {
diff --git a/packages/volto/src/components/theme/Comments/Comments.jsx b/packages/volto/src/components/theme/Comments/Comments.jsx
index bc0212c185..59fd64d405 100644
--- a/packages/volto/src/components/theme/Comments/Comments.jsx
+++ b/packages/volto/src/components/theme/Comments/Comments.jsx
@@ -13,7 +13,9 @@ import {
listComments,
listMoreComments,
} from '@plone/volto/actions';
-import { Avatar, CommentEditModal, Form } from '@plone/volto/components';
+import { Avatar } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
+import { CommentEditModal } from '@plone/volto/components/theme/Comments';
import {
flattenToAppURL,
getBaseUrl,
diff --git a/packages/volto/src/components/theme/Comments/Comments.test.jsx b/packages/volto/src/components/theme/Comments/Comments.test.jsx
index 1ea8663e7d..d971f25988 100644
--- a/packages/volto/src/components/theme/Comments/Comments.test.jsx
+++ b/packages/volto/src/components/theme/Comments/Comments.test.jsx
@@ -15,6 +15,8 @@ jest.mock('moment', () =>
);
jest.mock('@plone/volto/helpers/Loadable/Loadable');
+jest.mock('@plone/volto/components/manage/Form');
+
beforeAll(
async () =>
await require('@plone/volto/helpers/Loadable/Loadable').__setLoadables(),
diff --git a/packages/volto/src/components/theme/Comments/__mocks__/index.tsx b/packages/volto/src/components/theme/Comments/__mocks__/index.tsx
new file mode 100644
index 0000000000..9436abd49a
--- /dev/null
+++ b/packages/volto/src/components/theme/Comments/__mocks__/index.tsx
@@ -0,0 +1 @@
+export const CommentEditModal = () =>
;
diff --git a/packages/volto/src/components/theme/Comments/__snapshots__/CommentEditModal.test.jsx.snap b/packages/volto/src/components/theme/Comments/__snapshots__/CommentEditModal.test.jsx.snap
index 0947a1d37b..69a7999859 100644
--- a/packages/volto/src/components/theme/Comments/__snapshots__/CommentEditModal.test.jsx.snap
+++ b/packages/volto/src/components/theme/Comments/__snapshots__/CommentEditModal.test.jsx.snap
@@ -2,6 +2,28 @@
exports[`CommentEditModal renders a comment edit modal component 1`] = `
`;
diff --git a/packages/volto/src/components/theme/Comments/__snapshots__/Comments.test.jsx.snap b/packages/volto/src/components/theme/Comments/__snapshots__/Comments.test.jsx.snap
index 46415e2d17..d242bec191 100644
--- a/packages/volto/src/components/theme/Comments/__snapshots__/Comments.test.jsx.snap
+++ b/packages/volto/src/components/theme/Comments/__snapshots__/Comments.test.jsx.snap
@@ -8,90 +8,29 @@ exports[`Comments renders a comments component 1`] = `
id="comment-add-id"
>
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"fields\\": [
+ \\"comment\\"
+ ],
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\"
+ }
+ ],
+ \\"properties\\": {
+ \\"comment\\": {
+ \\"title\\": \\"Comment\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"textarea\\"
+ }
+ },
+ \\"required\\": [
+ \\"comment1\\"
+ ]
+}"
+ id="Form"
+ />
import('@plone/volto/components/theme/Comments/CommentEditModal'),
+);
diff --git a/packages/volto/src/components/theme/ContactForm/ContactForm.jsx b/packages/volto/src/components/theme/ContactForm/ContactForm.jsx
index 480b9fdb8e..150db350a4 100644
--- a/packages/volto/src/components/theme/ContactForm/ContactForm.jsx
+++ b/packages/volto/src/components/theme/ContactForm/ContactForm.jsx
@@ -7,7 +7,8 @@ import { toast } from 'react-toastify';
import { emailNotification } from '@plone/volto/actions';
import { useDispatch, useSelector } from 'react-redux';
-import { Form, Toolbar, Toast } from '@plone/volto/components';
+import { Toolbar, Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { getBaseUrl, Helmet, usePrevious } from '@plone/volto/helpers';
import { useClient } from '@plone/volto/hooks';
diff --git a/packages/volto/src/components/theme/ContactForm/ContactForm.test.jsx b/packages/volto/src/components/theme/ContactForm/ContactForm.test.jsx
index cd38a3a5c9..d2cbdecf8e 100644
--- a/packages/volto/src/components/theme/ContactForm/ContactForm.test.jsx
+++ b/packages/volto/src/components/theme/ContactForm/ContactForm.test.jsx
@@ -9,6 +9,8 @@ jest.mock('../../manage/Toolbar/Toolbar', () =>
jest.fn(() =>
),
);
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
describe('Contact form', () => {
it('renders a contact form', () => {
diff --git a/packages/volto/src/components/theme/ContactForm/__snapshots__/ContactForm.test.jsx.snap b/packages/volto/src/components/theme/ContactForm/__snapshots__/ContactForm.test.jsx.snap
index 32561ac0c3..133c932f0a 100644
--- a/packages/volto/src/components/theme/ContactForm/__snapshots__/ContactForm.test.jsx.snap
+++ b/packages/volto/src/components/theme/ContactForm/__snapshots__/ContactForm.test.jsx.snap
@@ -27,97 +27,45 @@ exports[`Contact form renders a contact form 1`] = `
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"fields\\": [
+ \\"name\\",
+ \\"from\\",
+ \\"subject\\",
+ \\"message\\"
+ ],
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\"
+ }
+ ],
+ \\"properties\\": {
+ \\"name\\": {
+ \\"title\\": \\"Name\\",
+ \\"type\\": \\"string\\"
+ },
+ \\"from\\": {
+ \\"title\\": \\"From\\",
+ \\"type\\": \\"email\\"
+ },
+ \\"subject\\": {
+ \\"title\\": \\"Subject\\",
+ \\"type\\": \\"string\\"
+ },
+ \\"message\\": {
+ \\"title\\": \\"Message\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"textarea\\"
+ }
+ },
+ \\"required\\": [
+ \\"from\\",
+ \\"message\\"
+ ]
+}"
+ id="Form"
+ />
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"fields\\": [
+ \\"name\\",
+ \\"from\\",
+ \\"subject\\",
+ \\"message\\"
+ ],
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\"
+ }
+ ],
+ \\"properties\\": {
+ \\"name\\": {
+ \\"title\\": \\"Name\\",
+ \\"type\\": \\"string\\"
+ },
+ \\"from\\": {
+ \\"title\\": \\"From\\",
+ \\"type\\": \\"email\\"
+ },
+ \\"subject\\": {
+ \\"title\\": \\"Subject\\",
+ \\"type\\": \\"string\\"
+ },
+ \\"message\\": {
+ \\"title\\": \\"Message\\",
+ \\"type\\": \\"string\\",
+ \\"widget\\": \\"textarea\\"
+ }
+ },
+ \\"required\\": [
+ \\"from\\",
+ \\"message\\"
+ ]
+}"
+ id="Form"
+ />
{
diff --git a/packages/volto/src/components/theme/PasswordReset/__snapshots__/RequestPasswordReset.test.jsx.snap b/packages/volto/src/components/theme/PasswordReset/__snapshots__/RequestPasswordReset.test.jsx.snap
index 0eaf6db99a..c19a375f48 100644
--- a/packages/volto/src/components/theme/PasswordReset/__snapshots__/RequestPasswordReset.test.jsx.snap
+++ b/packages/volto/src/components/theme/PasswordReset/__snapshots__/RequestPasswordReset.test.jsx.snap
@@ -8,109 +8,29 @@ exports[`RequestPasswordReset renders a RequestPasswordReset component 1`] = `
className="ui container"
>
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"username\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"username\\": {
+ \\"type\\": \\"string\\",
+ \\"title\\": \\"My user name is\\"
+ }
+ },
+ \\"submitLabel\\": \\"Start password reset\\",
+ \\"required\\": [
+ \\"username\\"
+ ]
+}"
+ id="Form"
+ />
`;
diff --git a/packages/volto/src/components/theme/Register/Register.jsx b/packages/volto/src/components/theme/Register/Register.jsx
index 565424c3e2..f993e455cf 100644
--- a/packages/volto/src/components/theme/Register/Register.jsx
+++ b/packages/volto/src/components/theme/Register/Register.jsx
@@ -12,7 +12,8 @@ import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
import { toast } from 'react-toastify';
-import { Form, Toast } from '@plone/volto/components';
+import { Toast } from '@plone/volto/components';
+import { Form } from '@plone/volto/components/manage/Form';
import { createUser } from '@plone/volto/actions';
const messages = defineMessages({
diff --git a/packages/volto/src/components/theme/Register/Register.test.jsx b/packages/volto/src/components/theme/Register/Register.test.jsx
index f78c37ecbf..cac8ca499c 100644
--- a/packages/volto/src/components/theme/Register/Register.test.jsx
+++ b/packages/volto/src/components/theme/Register/Register.test.jsx
@@ -6,6 +6,8 @@ import { MemoryRouter } from 'react-router-dom';
import Register from './Register';
+jest.mock('@plone/volto/components/manage/Form');
+
const mockStore = configureStore();
describe('Register', () => {
diff --git a/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap b/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap
index 965e380a54..c75ba527ee 100644
--- a/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap
+++ b/packages/volto/src/components/theme/Register/__snapshots__/Register.test.jsx.snap
@@ -5,86 +5,35 @@ exports[`Register renders a register component 1`] = `
id="page-register"
>
+ data-schema="{
+ \\"fieldsets\\": [
+ {
+ \\"id\\": \\"default\\",
+ \\"title\\": \\"Default\\",
+ \\"fields\\": [
+ \\"fullname\\",
+ \\"email\\"
+ ]
+ }
+ ],
+ \\"properties\\": {
+ \\"fullname\\": {
+ \\"type\\": \\"string\\",
+ \\"title\\": \\"Full Name\\",
+ \\"description\\": \\"Enter full name, e.g. John Smith.\\"
+ },
+ \\"email\\": {
+ \\"type\\": \\"string\\",
+ \\"title\\": \\"E-mail\\",
+ \\"description\\": \\"Enter an email address. This will be your login name. We respect your privacy, and will not give the address away to any third parties or expose it anywhere.\\"
+ }
+ },
+ \\"required\\": [
+ \\"fullname\\",
+ \\"email\\"
+ ]
+}"
+ id="Form"
+ />
`;
diff --git a/packages/volto/src/config/ControlPanels.js b/packages/volto/src/config/ControlPanels.js
index 2f6a763986..31614556b0 100644
--- a/packages/volto/src/config/ControlPanels.js
+++ b/packages/volto/src/config/ControlPanels.js
@@ -44,7 +44,7 @@ export const controlPanelsIcons = {
relations: relationsSVG,
};
-export const filterControlPanels = (controlpanels) => {
+export const filterControlPanels = (controlpanels = []) => {
const HIDDEN_CONTROL_PANELS = ['markup', 'content-rules'];
return controlpanels.filter(
diff --git a/packages/volto/src/config/Widgets.jsx b/packages/volto/src/config/Widgets.jsx
index c781794de6..66ed6bd869 100644
--- a/packages/volto/src/config/Widgets.jsx
+++ b/packages/volto/src/config/Widgets.jsx
@@ -1,39 +1,36 @@
-// The Widgets are forced to be imported not from the index but from its own
-// full path due to circular import issues
-
-import loadable from '@loadable/component';
-
-import AlignWidget from '@plone/volto/components/manage/Widgets/AlignWidget';
-import ButtonsWidget from '@plone/volto/components/manage/Widgets/ButtonsWidget';
-import ArrayWidget from '@plone/volto/components/manage/Widgets/ArrayWidget';
-import CheckboxWidget from '@plone/volto/components/manage/Widgets/CheckboxWidget';
-import FileWidget from '@plone/volto/components/manage/Widgets/FileWidget';
-import IdWidget from '@plone/volto/components/manage/Widgets/IdWidget';
-import PasswordWidget from '@plone/volto/components/manage/Widgets/PasswordWidget';
-import QueryWidget from '@plone/volto/components/manage/Widgets/QueryWidget';
-import QuerySortOnWidget from '@plone/volto/components/manage/Widgets/QuerySortOnWidget';
-import QuerystringWidget from '@plone/volto/components/manage/Widgets/QuerystringWidget';
-import SchemaWidget from '@plone/volto/components/manage/Widgets/SchemaWidget';
-import SelectWidget from '@plone/volto/components/manage/Widgets/SelectWidget';
-import TextareaWidget from '@plone/volto/components/manage/Widgets/TextareaWidget';
-import TextWidget from '@plone/volto/components/manage/Widgets/TextWidget';
-import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';
-import UrlWidget from '@plone/volto/components/manage/Widgets/UrlWidget';
-import InternalUrlWidget from '@plone/volto/components/manage/Widgets/InternalUrlWidget';
-import EmailWidget from '@plone/volto/components/manage/Widgets/EmailWidget';
-import NumberWidget from '@plone/volto/components/manage/Widgets/NumberWidget';
-import ImageSizeWidget from '@plone/volto/components/manage/Widgets/ImageSizeWidget';
-import RegistryImageWidget from '@plone/volto/components/manage/Widgets/RegistryImageWidget';
-
-import ReferenceWidget from '@plone/volto/components/manage/Widgets/ReferenceWidget';
-import ObjectBrowserWidget from '@plone/volto/components/manage/Widgets/ObjectBrowserWidget';
-
-import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget';
-import ObjectListWidget from '@plone/volto/components/manage/Widgets/ObjectListWidget';
-import VocabularyTermsWidget from '@plone/volto/components/manage/Widgets/VocabularyTermsWidget';
-import SelectMetadataWidget from '@plone/volto/components/manage/Blocks/Search/widgets/SelectMetadataField';
-import SelectAutoComplete from '@plone/volto/components/manage/Widgets/SelectAutoComplete';
-import ColorPickerWidget from '@plone/volto/components/manage/Widgets/ColorPickerWidget';
+import {
+ AlignWidget,
+ ButtonsWidget,
+ ArrayWidget,
+ CheckboxWidget,
+ FileWidget,
+ IdWidget,
+ PasswordWidget,
+ QueryWidget,
+ QuerySortOnWidget,
+ QuerystringWidget,
+ SchemaWidget,
+ SelectWidget,
+ TextareaWidget,
+ TextWidget,
+ TokenWidget,
+ UrlWidget,
+ InternalUrlWidget,
+ EmailWidget,
+ NumberWidget,
+ ImageSizeWidget,
+ RegistryImageWidget,
+ ReferenceWidget,
+ ObjectBrowserWidget,
+ ObjectWidget,
+ ObjectListWidget,
+ VocabularyTermsWidget,
+ SelectMetadataWidget,
+ SelectAutoComplete,
+ ColorPickerWidget,
+ DatetimeWidget,
+ RecurrenceWidget,
+} from '@plone/volto/components/manage/Widgets';
import ArrayViewWidget from '@plone/volto/components/theme/Widgets/ArrayWidget';
import BooleanViewWidget from '@plone/volto/components/theme/Widgets/BooleanWidget';
@@ -54,16 +51,6 @@ import TitleViewWidget from '@plone/volto/components/theme/Widgets/TitleWidget';
import TokenViewWidget from '@plone/volto/components/theme/Widgets/TokenWidget';
import UrlViewWidget from '@plone/volto/components/theme/Widgets/UrlWidget';
-export const DatetimeWidget = loadable(
- () => import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
-);
-export const RecurrenceWidget = loadable(
- () =>
- import(
- '@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
- ),
-);
-
// Widgets mapping
export const widgetMapping = {
id: {
diff --git a/packages/volto/src/routes.js b/packages/volto/src/routes.js
index a1fb227a57..5884f2364d 100644
--- a/packages/volto/src/routes.js
+++ b/packages/volto/src/routes.js
@@ -6,19 +6,10 @@ import debug from 'debug';
import { compact } from 'lodash';
import {
Add,
- AddonsControlpanel,
Aliases,
ChangePassword,
ContactForm,
- Contents,
- ContentType,
- ContentTypeLayout,
- ContentTypeSchema,
- ContentTypes,
- Controlpanel,
- Controlpanels,
CreateTranslation,
- DatabaseInformation,
Delete,
Diff,
Edit,
@@ -27,28 +18,39 @@ import {
Login,
Logout,
ManageTranslations,
- ModerateComments,
NotFound,
PasswordReset,
- Relations,
Register,
- Rules,
RequestPasswordReset,
Search,
Sharing,
Sitemap,
- AliasesControlpanel,
- UndoControlpanel,
- UsersControlpanel,
- UserGroupMembershipControlPanel,
- GroupsControlpanel,
+ PersonalInformation,
+} from '@plone/volto/components';
+import { Contents } from '@plone/volto/components/manage/Contents';
+import { Rules } from '@plone/volto/components/manage/Rules';
+import {
RulesControlpanel,
AddRuleControlpanel,
EditRuleControlpanel,
ConfigureRuleControlpanel,
+ UsersControlpanel,
+ UserGroupMembershipControlPanel,
+ GroupsControlpanel,
+ AddonsControlpanel,
+ AliasesControlpanel,
+ ContentType,
+ ContentTypeLayout,
+ ContentTypeSchema,
+ ContentTypes,
+ Controlpanel,
+ Controlpanels,
+ DatabaseInformation,
+ ModerateComments,
+ RelationsControlpanel,
+ UndoControlpanel,
UpgradeControlPanel,
- PersonalInformation,
-} from '@plone/volto/components';
+} from '@plone/volto/components/manage/Controlpanels';
// Deliberatelly use of absolute path of these components, since we do not want them
// in the components/index.js file.
@@ -228,7 +230,7 @@ export const defaultRoutes = [
},
{
path: '/controlpanel/relations',
- component: Relations,
+ component: RelationsControlpanel,
},
{
path: '/controlpanel/:id',
diff --git a/packages/volto/theme/themes/pastanaga/elements/input.overrides b/packages/volto/theme/themes/pastanaga/elements/input.overrides
index 2637218f62..ef897adb09 100644
--- a/packages/volto/theme/themes/pastanaga/elements/input.overrides
+++ b/packages/volto/theme/themes/pastanaga/elements/input.overrides
@@ -98,9 +98,11 @@ of an error is present, it overrides a default from SemanticUI grid definitions.
&.clear-search-button {
//needed for focus
margin-left: 0.1em;
+
svg.icon {
margin: auto;
}
+
&:focus,
&:hover {
-webkit-box-shadow: none;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7a46517b00..c1f93aea67 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2045,6 +2045,9 @@ importers:
'@types/jest':
specifier: ^29.5.8
version: 29.5.8
+ '@types/loadable__component':
+ specifier: ^5.13.9
+ version: 5.13.9
'@types/lodash':
specifier: ^4.14.201
version: 4.14.201
@@ -14257,6 +14260,12 @@ packages:
'@types/node': 20.9.0
dev: false
+ /@types/loadable__component@5.13.9:
+ resolution: {integrity: sha512-QWOtIkwZqHNdQj3nixQ8oyihQiTMKZLk/DNuvNxMSbTfxf47w+kqcbnxlUeBgAxdOtW0Dh48dTAIp83iJKtnrQ==}
+ dependencies:
+ '@types/react': 18.2.60
+ dev: true
+
/@types/lodash@4.14.201:
resolution: {integrity: sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ==}
@@ -31817,6 +31826,9 @@ packages:
resolution: {integrity: sha512-W+gxAq7aQ9dJIg/XLKGcRT0cvnStFAQHPaI0pvD0U2l6IVLueUAm3nwN7lkY62zZNmlvNx6jNtE4wlbS+CyqSg==}
engines: {node: '>= 12.0.0'}
hasBin: true
+ peerDependenciesMeta:
+ '@parcel/core':
+ optional: true
dependencies:
'@parcel/config-default': 2.12.0(@parcel/core@2.12.0)(postcss@8.4.35)(typescript@5.4.2)
'@parcel/core': 2.12.0