diff --git a/.eslintignore b/.eslintignore index 77fb2df91b..528a96d8de 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ packages/volto-guillotina dist packages/registry/lib packages/registry/docs +apps/rr7/.react-router diff --git a/docs/source/upgrade-guide/index.md b/docs/source/upgrade-guide/index.md index b527a00374..23e2903a18 100644 --- a/docs/source/upgrade-guide/index.md +++ b/docs/source/upgrade-guide/index.md @@ -723,11 +723,18 @@ Modern bundlers, such as Vite, rely upon the import path to determine whether to The barrel imports must be removed to increase the natural number of chunks that Volto divides on—especially on routes—resulting in code splitting done the right and natural way. This forces us to rewrite all the imports everywhere—including core, projects, and add-ons—once we implement it. -The barrel imports files include the following. +The barrel imports files include the following in Volto. - {file}`src/components/index.js` - {file}`src/helpers/index.js` - {file}`src/actions/index.js` +- {file}`src/hooks/index.js` + +They also include the following in the `@plone/volto-slate` package. + +- {file}`src/actions/index.js` +- {file}`src/editor/ui/index.js` +- {file}`src/utils/index.js` ##### Alternative diff --git a/packages/coresandbox/src/components/Blocks/FormBlock/Edit.tsx b/packages/coresandbox/src/components/Blocks/FormBlock/Edit.tsx index 225b91ae4f..866f4e4c38 100644 --- a/packages/coresandbox/src/components/Blocks/FormBlock/Edit.tsx +++ b/packages/coresandbox/src/components/Blocks/FormBlock/Edit.tsx @@ -1,7 +1,7 @@ -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import Data from './Data'; import type { BlockEditProps } from '@plone/types'; -import { Helmet } from '@plone/volto/helpers'; +import { Helmet } from '@plone/volto/helpers/Helmet/Helmet'; import { defineMessages, useIntl } from 'react-intl'; import { Container } from 'semantic-ui-react'; diff --git a/packages/coresandbox/src/components/Blocks/InputBlock/Edit.tsx b/packages/coresandbox/src/components/Blocks/InputBlock/Edit.tsx index 543f4aeba8..01bc774bd4 100644 --- a/packages/coresandbox/src/components/Blocks/InputBlock/Edit.tsx +++ b/packages/coresandbox/src/components/Blocks/InputBlock/Edit.tsx @@ -1,9 +1,9 @@ import React, { useEffect } from 'react'; -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import Data from './Data'; import type { BlockEditProps } from '@plone/types'; import { Input, Button } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import aheadSVG from '@plone/volto/icons/ahead.svg'; const InputBlockEdit = (props: BlockEditProps) => { diff --git a/packages/coresandbox/src/components/Blocks/TestBlock/Edit.tsx b/packages/coresandbox/src/components/Blocks/TestBlock/Edit.tsx index fd858204c7..0d075c9c5d 100644 --- a/packages/coresandbox/src/components/Blocks/TestBlock/Edit.tsx +++ b/packages/coresandbox/src/components/Blocks/TestBlock/Edit.tsx @@ -1,4 +1,4 @@ -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import Data from './Data'; import type { BlockEditProps } from '@plone/types'; diff --git a/packages/coresandbox/src/components/TestForm.jsx b/packages/coresandbox/src/components/TestForm.jsx index 23fa15787e..1a916a22d8 100644 --- a/packages/coresandbox/src/components/TestForm.jsx +++ b/packages/coresandbox/src/components/TestForm.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Helmet } from '@plone/volto/helpers'; +import { Helmet } from '@plone/volto/helpers/Helmet/Helmet'; import { defineMessages, useIntl } from 'react-intl'; import { Container } from 'semantic-ui-react'; diff --git a/packages/coresandbox/src/components/Views/NewsAndEvents.tsx b/packages/coresandbox/src/components/Views/NewsAndEvents.tsx index 4ef7d1fc52..acdba48de2 100644 --- a/packages/coresandbox/src/components/Views/NewsAndEvents.tsx +++ b/packages/coresandbox/src/components/Views/NewsAndEvents.tsx @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { searchContent } from '@plone/volto/actions'; +import { searchContent } from '@plone/volto/actions/search/search'; import { useDispatch, useSelector } from 'react-redux'; import { Container } from 'semantic-ui-react'; diff --git a/packages/coresandbox/src/index.ts b/packages/coresandbox/src/index.ts index 6bb0eb551c..a27e22cd2d 100644 --- a/packages/coresandbox/src/index.ts +++ b/packages/coresandbox/src/index.ts @@ -4,7 +4,7 @@ import TestBlockView from './components/Blocks/TestBlock/View'; import TestBlockEdit from './components/Blocks/TestBlock/Edit'; import InputBlockView from './components/Blocks/InputBlock/View'; import InputBlockEdit from './components/Blocks/InputBlock/Edit'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { SliderSchema as TestBlockSchema } from './components/Blocks/TestBlock/schema'; import { inputBlockSchema } from './components/Blocks/InputBlock/schema'; import { multipleFieldsetsSchema } from './components/Blocks/TestBlock/schema'; @@ -13,13 +13,13 @@ import codeSVG from '@plone/volto/icons/code.svg'; import type { BlockConfigBase } from '@plone/types'; import type { ConfigType } from '@plone/registry'; import SlotComponentTest from './components/Slots/SlotTest'; -import { ContentTypeCondition } from '@plone/volto/helpers'; +import { ContentTypeCondition } from '@plone/volto/helpers/Slots'; import { RouteCondition } from '@plone/volto/helpers/Slots'; import TestForm from './components/TestForm'; import FormBlockView from './components/Blocks/FormBlock/View'; import FormBlockEdit from './components/Blocks/FormBlock/Edit'; import { formBlockSchema } from './components/Blocks/FormBlock/schema'; -import { Login } from '@plone/volto/components'; +import Login from '@plone/volto/components/theme/Login/Login'; const testBlock: BlockConfigBase = { id: 'testBlock', diff --git a/packages/volto-slate/.eslintrc.js b/packages/volto-slate/.eslintrc.js index 8a109bea44..f190db2eba 100644 --- a/packages/volto-slate/.eslintrc.js +++ b/packages/volto-slate/.eslintrc.js @@ -3,4 +3,11 @@ module.exports = { rules: { 'import/no-unresolved': 0, }, + settings: { + 'import/resolver': { + alias: { + map: [['@plone/volto-slate', './src']], + }, + }, + }, }; diff --git a/packages/volto-slate/news/6509.internal b/packages/volto-slate/news/6509.internal new file mode 100644 index 0000000000..446507b2f0 --- /dev/null +++ b/packages/volto-slate/news/6509.internal @@ -0,0 +1 @@ +Removed all imports from barrel files for components, actions, helpers, hooks and lodash. @pnicolli diff --git a/packages/volto-slate/src/actions/content.js b/packages/volto-slate/src/actions/content.js index ea00e9f155..39aea1d5c7 100644 --- a/packages/volto-slate/src/actions/content.js +++ b/packages/volto-slate/src/actions/content.js @@ -1,4 +1,4 @@ -import { nestContent } from '@plone/volto/helpers'; +import { nestContent } from '@plone/volto/helpers/Content/Content'; import { UPLOAD_CONTENT } from '@plone/volto-slate/constants'; // TODO: the PR has been merged into Volto, so this should be cleaned up diff --git a/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx b/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx index 96a493e9aa..cc6b381b80 100644 --- a/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx +++ b/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx @@ -5,13 +5,16 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { isEmpty, map, remove } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; +import map from 'lodash/map'; +import remove from 'lodash/remove'; import { Button, Table } from 'semantic-ui-react'; import cx from 'classnames'; import { defineMessages, injectIntl } from 'react-intl'; import Cell from './Cell'; -import { Icon, SidebarPortal } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import TableSchema from './schema'; diff --git a/packages/volto-slate/src/blocks/Table/TableBlockView.jsx b/packages/volto-slate/src/blocks/Table/TableBlockView.jsx index 4e10c84dcc..6709862008 100644 --- a/packages/volto-slate/src/blocks/Table/TableBlockView.jsx +++ b/packages/volto-slate/src/blocks/Table/TableBlockView.jsx @@ -6,7 +6,7 @@ import React, { useState, useMemo } from 'react'; import PropTypes from 'prop-types'; import { Table } from 'semantic-ui-react'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { serializeNodes, serializeNodesToText, diff --git a/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx b/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx index eeb1450dd9..385cc84a65 100644 --- a/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx +++ b/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx @@ -6,22 +6,20 @@ import { defineMessages, useIntl } from 'react-intl'; import { useInView } from 'react-intersection-observer'; import { Dimmer, Loader, Message, Segment } from 'semantic-ui-react'; -import { - flattenToAppURL, - getBaseUrl, - validateFileUploadSize, -} from '@plone/volto/helpers'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; import config from '@plone/volto/registry'; -import { SidebarPortal, BlockChooserButton } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; +import BlockChooserButton from '@plone/volto/components/manage/BlockChooser/BlockChooserButton'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import { SlateEditor } from '@plone/volto-slate/editor'; import { serializeNodesToText } from '@plone/volto-slate/editor/render'; import { createImageBlock, - parseDefaultSelection, deconstructToVoltoBlocks, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/volto-blocks'; +import { parseDefaultSelection } from '@plone/volto-slate/utils/selection'; import { Transforms } from 'slate'; import PersistentSlashMenu from './SlashMenu'; diff --git a/packages/volto-slate/src/blocks/Text/SlashMenu.jsx b/packages/volto-slate/src/blocks/Text/SlashMenu.jsx index 9ec1612304..d9e2882108 100644 --- a/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +++ b/packages/volto-slate/src/blocks/Text/SlashMenu.jsx @@ -1,10 +1,11 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { filter, isEmpty } from 'lodash'; +import filter from 'lodash/filter'; +import isEmpty from 'lodash/isEmpty'; import { Menu } from 'semantic-ui-react'; import { useIntl, FormattedMessage } from 'react-intl'; -import { Icon } from '@plone/volto/components'; -import { useUser } from '@plone/volto/hooks'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import useUser from '@plone/volto/hooks/user/useUser'; const emptySlateBlock = () => ({ value: [ diff --git a/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx b/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx index 7a37884875..0c91b4c56e 100644 --- a/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx +++ b/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx @@ -2,10 +2,8 @@ import React from 'react'; import { connect } from 'react-redux'; -import { - uploadContent, - saveSlateBlockSelection, -} from '@plone/volto-slate/actions'; +import { uploadContent } from '@plone/volto-slate/actions/content'; +import saveSlateBlockSelection from '@plone/volto-slate/actions/selection'; import DefaultTextBlockEditor from './DefaultTextBlockEditor'; import DetachedTextBlockEditor from './DetachedTextBlockEditor'; diff --git a/packages/volto-slate/src/blocks/Text/TextBlockView.jsx b/packages/volto-slate/src/blocks/Text/TextBlockView.jsx index e25e603093..e78ea9d431 100644 --- a/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +++ b/packages/volto-slate/src/blocks/Text/TextBlockView.jsx @@ -3,9 +3,9 @@ import { serializeNodesToText, } from '@plone/volto-slate/editor/render'; import config from '@plone/volto/registry'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; import Slugger from 'github-slugger'; -import { normalizeString } from '@plone/volto/helpers'; +import { normalizeString } from '@plone/volto/helpers/Utils/Utils'; const TextBlockView = (props) => { const { id, data, styling = {} } = props; diff --git a/packages/volto-slate/src/blocks/Text/extensions/breakList.js b/packages/volto-slate/src/blocks/Text/extensions/breakList.js index 81f0efd221..515b8c4c67 100644 --- a/packages/volto-slate/src/blocks/Text/extensions/breakList.js +++ b/packages/volto-slate/src/blocks/Text/extensions/breakList.js @@ -1,13 +1,11 @@ import { Editor, Range, Transforms } from 'slate'; import config from '@plone/volto/registry'; -import { - isCursorAtBlockEnd, - splitEditorInTwoFragments, - setEditorContent, - createAndSelectNewBlockAfter, - getCurrentListItem, - createEmptyParagraph, -} from '@plone/volto-slate/utils'; +import { isCursorAtBlockEnd } from '@plone/volto-slate/utils/selection'; +import { splitEditorInTwoFragments } from '@plone/volto-slate/utils/ops'; +import { setEditorContent } from '@plone/volto-slate/utils/editor'; +import { createAndSelectNewBlockAfter } from '@plone/volto-slate/utils/volto-blocks'; +import { getCurrentListItem } from '@plone/volto-slate/utils/lists'; +import { createEmptyParagraph } from '@plone/volto-slate/utils/blocks'; /** * Handles `Enter` key on empty and non-empty list items. diff --git a/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js b/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js index c7ffae1a23..91846daf3e 100644 --- a/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js +++ b/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js @@ -1,13 +1,10 @@ import ReactDOM from 'react-dom'; import { Editor } from 'slate'; // import { ReactEditor } from 'slate-react'; -import { - splitEditorInTwoFragments, - setEditorContent, - createAndSelectNewBlockAfter, - rangeIsInSplittableNode, - // deconstructToVoltoBlocks, -} from '@plone/volto-slate/utils'; +import { splitEditorInTwoFragments } from '@plone/volto-slate/utils/ops'; +import { setEditorContent } from '@plone/volto-slate/utils/editor'; +import { createAndSelectNewBlockAfter } from '@plone/volto-slate/utils/volto-blocks'; +import { rangeIsInSplittableNode } from '@plone/volto-slate/utils/internals'; /** * @param {Editor} editor The Slate editor object to extend. diff --git a/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js b/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js index dc994f80a8..e22e35b4d1 100644 --- a/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js +++ b/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js @@ -1,7 +1,8 @@ import isUrl from 'is-url'; import imageExtensions from 'image-extensions'; import { blockTagDeserializer } from '@plone/volto-slate/editor/deserialize'; -import { getBaseUrl, validateFileUploadSize } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; import { v4 as uuid } from 'uuid'; import { Transforms } from 'slate'; diff --git a/packages/volto-slate/src/blocks/Text/index.jsx b/packages/volto-slate/src/blocks/Text/index.jsx index 61ba8b500d..64c0a8017f 100644 --- a/packages/volto-slate/src/blocks/Text/index.jsx +++ b/packages/volto-slate/src/blocks/Text/index.jsx @@ -2,7 +2,7 @@ import React from 'react'; import TextBlockView from './TextBlockView'; import TextBlockEdit from './TextBlockEdit'; import TextBlockSchema from './TextBlockSchema'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import { goDown, diff --git a/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js b/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js index 2fe86e2e09..dddbfea2ee 100644 --- a/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js +++ b/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js @@ -3,8 +3,8 @@ import config from '@plone/volto/registry'; import { isCursorInList, isCursorAtListBlockStart, - deconstructToVoltoBlocks, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/lists'; +import { deconstructToVoltoBlocks } from '@plone/volto-slate/utils/volto-blocks'; /** * Handle the new Volto blocks created by `deconstructToVoltoBlocks`. diff --git a/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js b/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js index 4f9f81cba2..d137d9a1fb 100644 --- a/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js +++ b/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js @@ -1,11 +1,11 @@ import { Editor, Path, Transforms } from 'slate'; import { isCursorInList, - deconstructToVoltoBlocks, getCurrentListItem, mergeWithNextList, mergeWithPreviousList, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/lists'; +import { deconstructToVoltoBlocks } from '@plone/volto-slate/utils/volto-blocks'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js b/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js index 4dbf7bc03a..8c166f8c0f 100644 --- a/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js +++ b/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js @@ -1,22 +1,24 @@ import ReactDOM from 'react-dom'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import { serializeNodesToText } from '@plone/volto-slate/editor/render'; import { Editor } from 'slate'; import { getPreviousVoltoBlock, getNextVoltoBlock, - isCursorAtBlockStart, - isCursorAtBlockEnd, mergeSlateWithBlockBackward, mergeSlateWithBlockForward, - makeEditor, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/volto-blocks'; +import { + isCursorAtBlockStart, + isCursorAtBlockEnd, +} from '@plone/volto-slate/utils/selection'; +import { makeEditor } from '@plone/volto-slate/utils/editor'; import { changeBlock, deleteBlock, getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; /** * Joins the current block (which has an active Slate Editor) * with the previous block, to make a single block. diff --git a/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js b/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js index 1d977bedab..6f325e09b9 100644 --- a/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js +++ b/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js @@ -1,5 +1,8 @@ import { Editor, Path, Transforms, Node } from 'slate'; -import { isCursorInList, getCurrentListItem } from '@plone/volto-slate/utils'; +import { + isCursorInList, + getCurrentListItem, +} from '@plone/volto-slate/utils/lists'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js b/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js index 88ee26298f..f29abfba28 100644 --- a/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js +++ b/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js @@ -2,10 +2,12 @@ import { Node } from 'slate'; import { isCursorAtBlockStart, isCursorAtBlockEnd, +} from '@plone/volto-slate/utils/selection'; +import { getNextVoltoBlock, getPreviousVoltoBlock, - createDefaultBlock, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/volto-blocks'; +import { createDefaultBlock } from '@plone/volto-slate/utils/blocks'; /** * goUp. diff --git a/packages/volto-slate/src/editor/SlateEditor.jsx b/packages/volto-slate/src/editor/SlateEditor.jsx index fe8457b191..6327abb883 100644 --- a/packages/volto-slate/src/editor/SlateEditor.jsx +++ b/packages/volto-slate/src/editor/SlateEditor.jsx @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom'; import cx from 'classnames'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; import { Transforms, Editor } from 'slate'; // , Transforms import { Slate, Editable, ReactEditor } from 'slate-react'; import React, { Component } from 'react'; // , useState @@ -11,12 +11,10 @@ import config from '@plone/volto/registry'; import { Element, Leaf } from './render'; import withTestingFeatures from './extensions/withTestingFeatures'; -import { - makeEditor, - toggleInlineFormat, - toggleMark, - parseDefaultSelection, -} from '@plone/volto-slate/utils'; +import { makeEditor } from '@plone/volto-slate/utils/editor'; +import { toggleInlineFormat } from '@plone/volto-slate/utils/blocks'; +import { toggleMark } from '@plone/volto-slate/utils/marks'; +import { parseDefaultSelection } from '@plone/volto-slate/utils/selection'; import { InlineToolbar } from './ui'; import EditorContext from './EditorContext'; diff --git a/packages/volto-slate/src/editor/config.jsx b/packages/volto-slate/src/editor/config.jsx index d310812f7e..b52d6df413 100644 --- a/packages/volto-slate/src/editor/config.jsx +++ b/packages/volto-slate/src/editor/config.jsx @@ -15,7 +15,7 @@ import strikethroughIcon from '@plone/volto/icons/strikethrough.svg'; import subindexIcon from '@plone/volto/icons/subindex.svg'; import superindexIcon from '@plone/volto/icons/superindex.svg'; -import { createEmptyParagraph } from '@plone/volto-slate/utils'; +import { createEmptyParagraph } from '@plone/volto-slate/utils/blocks'; import { MarkElementButton, diff --git a/packages/volto-slate/src/editor/extensions/insertData.js b/packages/volto-slate/src/editor/extensions/insertData.js index 48c9a05f9b..ce95c3f91f 100644 --- a/packages/volto-slate/src/editor/extensions/insertData.js +++ b/packages/volto-slate/src/editor/extensions/insertData.js @@ -3,9 +3,9 @@ import { deserialize } from '@plone/volto-slate/editor/deserialize'; import { createBlock, createDefaultBlock, - MIMETypeName, normalizeExternalData, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/blocks'; +import { MIMETypeName } from '@plone/volto-slate/utils/mime-types'; import { isBlockActive } from '../../utils/blocks'; export const insertData = (editor) => { diff --git a/packages/volto-slate/src/editor/extensions/normalizeExternalData.js b/packages/volto-slate/src/editor/extensions/normalizeExternalData.js index d04c1d1255..a225372877 100644 --- a/packages/volto-slate/src/editor/extensions/normalizeExternalData.js +++ b/packages/volto-slate/src/editor/extensions/normalizeExternalData.js @@ -1,4 +1,4 @@ -import { normalizeExternalData as normalize } from '@plone/volto-slate/utils'; +import { normalizeExternalData as normalize } from '@plone/volto-slate/utils/blocks'; export function normalizeExternalData(editor) { editor.normalizeExternalData = (fragment) => { diff --git a/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx b/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx index 914092b788..3565c8fbf5 100644 --- a/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx +++ b/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; import { ReactEditor } from 'slate-react'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; const withTestingFeatures = (WrappedComponent) => { return (props) => { diff --git a/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js b/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js index 2359e452c8..8ce874b129 100644 --- a/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js +++ b/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js @@ -1,7 +1,7 @@ import { jsx } from 'slate-hyperscript'; import { LINK } from '@plone/volto-slate/constants'; import { deserialize } from '@plone/volto-slate/editor/deserialize'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; // import { Editor } from 'slate'; /** diff --git a/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx b/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx index 2af0400b94..12d9591d0d 100644 --- a/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx +++ b/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import './styles.less'; export const LinkElement = ({ attributes, children, element, mode }) => { diff --git a/packages/volto-slate/src/editor/plugins/Blockquote/index.jsx b/packages/volto-slate/src/editor/plugins/Blockquote/index.jsx index 6d0111bcb7..122c16a604 100644 --- a/packages/volto-slate/src/editor/plugins/Blockquote/index.jsx +++ b/packages/volto-slate/src/editor/plugins/Blockquote/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { BlockButton } from '@plone/volto-slate/editor/ui'; +import BlockButton from '@plone/volto-slate/editor/ui/BlockButton'; import quoteIcon from '@plone/volto/icons/quote.svg'; // TODO: this needs to use constants for el type diff --git a/packages/volto-slate/src/editor/plugins/Callout/index.jsx b/packages/volto-slate/src/editor/plugins/Callout/index.jsx index 3cad047b2e..edcc772fa6 100644 --- a/packages/volto-slate/src/editor/plugins/Callout/index.jsx +++ b/packages/volto-slate/src/editor/plugins/Callout/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { BlockButton } from '@plone/volto-slate/editor/ui'; +import BlockButton from '@plone/volto-slate/editor/ui/BlockButton'; import calloutSVG from '@plone/volto/icons/megaphone.svg'; // TODO: this needs to use constants for el type diff --git a/packages/volto-slate/src/editor/plugins/Link/index.jsx b/packages/volto-slate/src/editor/plugins/Link/index.jsx index c21296f75d..02b507404e 100644 --- a/packages/volto-slate/src/editor/plugins/Link/index.jsx +++ b/packages/volto-slate/src/editor/plugins/Link/index.jsx @@ -12,12 +12,10 @@ import { import { SIMPLELINK, LINK } from '@plone/volto-slate/constants'; import { LinkElement } from './render'; import { simpleLinkDeserializer, withSimpleLink } from './extensions'; -import { setPluginOptions } from '@plone/volto-slate/actions'; -import { - ToolbarButton as UIToolbarButton, - PositionedToolbar, -} from '@plone/volto-slate/editor/ui'; -import { useSelectionPosition } from '@plone/volto-slate/hooks'; +import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; +import UIToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; +import PositionedToolbar from '@plone/volto-slate/editor/ui/PositionedToolbar'; +import { useSelectionPosition } from '@plone/volto-slate/hooks/useSelectionPosition'; import linkSVG from '@plone/volto/icons/link.svg'; import unlinkSVG from '@plone/volto/icons/unlink.svg'; diff --git a/packages/volto-slate/src/editor/plugins/Link/render.jsx b/packages/volto-slate/src/editor/plugins/Link/render.jsx index 06174d5920..7df5fdd9bb 100644 --- a/packages/volto-slate/src/editor/plugins/Link/render.jsx +++ b/packages/volto-slate/src/editor/plugins/Link/render.jsx @@ -1,8 +1,8 @@ import React from 'react'; import cx from 'classnames'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import config from '@plone/volto/registry'; -import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers'; +import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers/Url/Url'; const ViewLink = ({ url, target, download, children }) => { const { openExternalLinkInNewTab } = config.settings; diff --git a/packages/volto-slate/src/editor/plugins/Markdown/constants.js b/packages/volto-slate/src/editor/plugins/Markdown/constants.js index 4798b26be3..125e7ab0b0 100644 --- a/packages/volto-slate/src/editor/plugins/Markdown/constants.js +++ b/packages/volto-slate/src/editor/plugins/Markdown/constants.js @@ -1,5 +1,5 @@ import { toggleList } from './utils'; -import { isBlockActive } from '@plone/volto-slate/utils'; +import { isBlockActive } from '@plone/volto-slate/utils/blocks'; import { UL, OL, LI, H2, H3, BLOCKQUOTE } from '@plone/volto-slate/constants'; /** diff --git a/packages/volto-slate/src/editor/plugins/Markdown/extensions.js b/packages/volto-slate/src/editor/plugins/Markdown/extensions.js index 0c40c05d11..fc7d2ed211 100644 --- a/packages/volto-slate/src/editor/plugins/Markdown/extensions.js +++ b/packages/volto-slate/src/editor/plugins/Markdown/extensions.js @@ -1,4 +1,5 @@ -import { castArray, map } from 'lodash'; +import castArray from 'lodash/castArray'; +import map from 'lodash/map'; import { Editor, Path, Point, Range, Transforms } from 'slate'; /** diff --git a/packages/volto-slate/src/editor/plugins/Markdown/utils.js b/packages/volto-slate/src/editor/plugins/Markdown/utils.js index db29e30a20..0151400256 100644 --- a/packages/volto-slate/src/editor/plugins/Markdown/utils.js +++ b/packages/volto-slate/src/editor/plugins/Markdown/utils.js @@ -3,7 +3,7 @@ import { getMaxRange, selectAll, getSelectionNodesArrayByType, -} from '@plone/volto-slate/utils'; +} from '@plone/volto-slate/utils/selection'; import { P, LI, UL, OL } from '@plone/volto-slate/constants'; export function unwrapNodesByType(editor, types, options = {}) { diff --git a/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx b/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx index 2771759873..42548d8e74 100644 --- a/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx +++ b/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx @@ -3,10 +3,10 @@ import { useSlate } from 'slate-react'; import { Dropdown } from 'semantic-ui-react'; import { useIntl, defineMessages } from 'react-intl'; import cx from 'classnames'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; import { isBlockStyleActive, isInlineStyleActive, toggleStyle } from './utils'; import config from '@plone/volto/registry'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; import paintSVG from '@plone/volto/icons/paint.svg'; const messages = defineMessages({ diff --git a/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js b/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js index 4090c8d750..04d76d0673 100644 --- a/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js +++ b/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js @@ -1,6 +1,6 @@ /* eslint no-console: ["error", { allow: ["warn", "error"] }] */ import { Editor, Transforms } from 'slate'; -import { isBlockActive } from '@plone/volto-slate/utils'; +import { isBlockActive } from '@plone/volto-slate/utils/blocks'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx b/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx index c892365f81..568678855b 100644 --- a/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx +++ b/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSlate } from 'slate-react'; import { Dropdown } from 'semantic-ui-react'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; import tableSVG from '@plone/volto/icons/table.svg'; import TableContainer from './TableContainer'; diff --git a/packages/volto-slate/src/editor/plugins/Table/index.jsx b/packages/volto-slate/src/editor/plugins/Table/index.jsx index d9f48edec2..df6d72a845 100644 --- a/packages/volto-slate/src/editor/plugins/Table/index.jsx +++ b/packages/volto-slate/src/editor/plugins/Table/index.jsx @@ -12,7 +12,7 @@ import colAfterSVG from '@plone/volto/icons/column-after.svg'; import rowDeleteSVG from '@plone/volto/icons/row-delete.svg'; import colDeleteSVG from '@plone/volto/icons/column-delete.svg'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; import { Range, Transforms, Editor, Path } from 'slate'; import { defineMessages, useIntl } from 'react-intl'; import { TABLE, TR, P, TD, TH } from '@plone/volto-slate/constants'; diff --git a/packages/volto-slate/src/editor/render.jsx b/packages/volto-slate/src/editor/render.jsx index 2d3aad41ad..ce73119d1b 100644 --- a/packages/volto-slate/src/editor/render.jsx +++ b/packages/volto-slate/src/editor/render.jsx @@ -6,9 +6,12 @@ import { useIntl } from 'react-intl'; import { useSelector } from 'react-redux'; import { Node, Text } from 'slate'; import cx from 'classnames'; -import { isEmpty, omit } from 'lodash'; -import { UniversalLink, Toast } from '@plone/volto/components'; -import { messages, addAppURL } from '@plone/volto/helpers'; +import isEmpty from 'lodash/isEmpty'; +import omit from 'lodash/omit'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { addAppURL } from '@plone/volto/helpers/Url/Url'; import useClipboard from '@plone/volto/hooks/clipboard/useClipboard'; import config from '@plone/volto/registry'; import linkSVG from '@plone/volto/icons/link.svg'; diff --git a/packages/volto-slate/src/editor/ui/BlockButton.jsx b/packages/volto-slate/src/editor/ui/BlockButton.jsx index ee03fbbed6..cdc70b6b0d 100644 --- a/packages/volto-slate/src/editor/ui/BlockButton.jsx +++ b/packages/volto-slate/src/editor/ui/BlockButton.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { useSlate } from 'slate-react'; -import { isBlockActive, toggleBlock } from '@plone/volto-slate/utils'; +import { isBlockActive, toggleBlock } from '@plone/volto-slate/utils/blocks'; import ToolbarButton from './ToolbarButton'; diff --git a/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx b/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx index c1b6f234a9..5708963f68 100644 --- a/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx +++ b/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { useSlate } from 'slate-react'; -import { clearFormatting } from '@plone/volto-slate/utils'; +import { clearFormatting } from '@plone/volto-slate/utils/blocks'; import ToolbarButton from './ToolbarButton'; diff --git a/packages/volto-slate/src/editor/ui/InlineToolbar.jsx b/packages/volto-slate/src/editor/ui/InlineToolbar.jsx index 0567645f91..ea1d501b51 100644 --- a/packages/volto-slate/src/editor/ui/InlineToolbar.jsx +++ b/packages/volto-slate/src/editor/ui/InlineToolbar.jsx @@ -2,7 +2,7 @@ import React from 'react'; // , useState import SlateToolbar from './SlateToolbar'; import SlateContextToolbar from './SlateContextToolbar'; import config from '@plone/volto/registry'; -import { hasRangeSelection } from '@plone/volto-slate/utils'; +import { hasRangeSelection } from '@plone/volto-slate/utils/selection'; import { ReactEditor } from 'slate-react'; import cx from 'classnames'; diff --git a/packages/volto-slate/src/editor/ui/MarkButton.jsx b/packages/volto-slate/src/editor/ui/MarkButton.jsx index d3433d50ab..affd3118d2 100644 --- a/packages/volto-slate/src/editor/ui/MarkButton.jsx +++ b/packages/volto-slate/src/editor/ui/MarkButton.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSlate } from 'slate-react'; -import { isMarkActive, toggleMark } from '@plone/volto-slate/utils'; +import { isMarkActive, toggleMark } from '@plone/volto-slate/utils/marks'; import ToolbarButton from './ToolbarButton'; const MarkButton = ({ format, icon, ...props }) => { diff --git a/packages/volto-slate/src/editor/ui/MarkElementButton.jsx b/packages/volto-slate/src/editor/ui/MarkElementButton.jsx index 87c6ba4b21..f18c53c0ae 100644 --- a/packages/volto-slate/src/editor/ui/MarkElementButton.jsx +++ b/packages/volto-slate/src/editor/ui/MarkElementButton.jsx @@ -1,6 +1,9 @@ import React from 'react'; import { useSlate } from 'slate-react'; -import { isBlockActive, toggleInlineFormat } from '@plone/volto-slate/utils'; +import { + isBlockActive, + toggleInlineFormat, +} from '@plone/volto-slate/utils/blocks'; import ToolbarButton from './ToolbarButton'; diff --git a/packages/volto-slate/src/editor/ui/ToolbarButton.jsx b/packages/volto-slate/src/editor/ui/ToolbarButton.jsx index 11754d2937..ef13c3f285 100644 --- a/packages/volto-slate/src/editor/ui/ToolbarButton.jsx +++ b/packages/volto-slate/src/editor/ui/ToolbarButton.jsx @@ -1,6 +1,6 @@ import cx from 'classnames'; import React from 'react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; import { useIntl } from 'react-intl'; diff --git a/packages/volto-slate/src/elementEditor/ContextButtons.jsx b/packages/volto-slate/src/elementEditor/ContextButtons.jsx index 65895888a8..3d9d0129cd 100644 --- a/packages/volto-slate/src/elementEditor/ContextButtons.jsx +++ b/packages/volto-slate/src/elementEditor/ContextButtons.jsx @@ -4,8 +4,8 @@ import { useIntl } from 'react-intl'; // , defineMessages import clearSVG from '@plone/volto/icons/delete.svg'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; -import { setPluginOptions } from '@plone/volto-slate/actions'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; +import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; /* * Note: this is a weirder component, it should be called as a native function diff --git a/packages/volto-slate/src/elementEditor/PluginEditor.jsx b/packages/volto-slate/src/elementEditor/PluginEditor.jsx index e33b87ec27..d820c19851 100644 --- a/packages/volto-slate/src/elementEditor/PluginEditor.jsx +++ b/packages/volto-slate/src/elementEditor/PluginEditor.jsx @@ -1,11 +1,11 @@ /* eslint no-console: ["error", { allow: ["error"] }] */ -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; import React from 'react'; import { useDispatch } from 'react-redux'; import { ReactEditor } from 'slate-react'; -import { Icon as VoltoIcon } from '@plone/volto/components'; +import VoltoIcon from '@plone/volto/components/theme/Icon/Icon'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; -import { setPluginOptions } from '@plone/volto-slate/actions'; +import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; import BaseSchemaProvider from './SchemaProvider'; import briefcaseSVG from '@plone/volto/icons/briefcase.svg'; diff --git a/packages/volto-slate/src/elementEditor/SidebarEditor.jsx b/packages/volto-slate/src/elementEditor/SidebarEditor.jsx index f91bef80de..bea02391c6 100644 --- a/packages/volto-slate/src/elementEditor/SidebarEditor.jsx +++ b/packages/volto-slate/src/elementEditor/SidebarEditor.jsx @@ -5,8 +5,8 @@ */ import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { SidebarPopup } from '@plone/volto/components'; -import { setPluginOptions } from '@plone/volto-slate/actions'; +import SidebarPopup from '@plone/volto/components/manage/Sidebar/SidebarPopup'; +import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; const SidebarEditor = (props) => { const { editor, pluginId, getActiveElement, pluginEditor } = props; diff --git a/packages/volto-slate/src/elementEditor/ToolbarButton.jsx b/packages/volto-slate/src/elementEditor/ToolbarButton.jsx index 3f26d6e73f..9c08c82cc8 100644 --- a/packages/volto-slate/src/elementEditor/ToolbarButton.jsx +++ b/packages/volto-slate/src/elementEditor/ToolbarButton.jsx @@ -4,11 +4,11 @@ import React from 'react'; import { useSlate } from 'slate-react'; import { useDispatch } from 'react-redux'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; -import { hasRangeSelection } from '@plone/volto-slate/utils'; -import { setPluginOptions } from '@plone/volto-slate/actions'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; +import { hasRangeSelection } from '@plone/volto-slate/utils/selection'; +import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; const ElementToolbarButton = (props) => { const { isActiveElement, insertElement, pluginId, toolbarButtonIcon } = props; diff --git a/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js b/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js index 0cf45e3d0e..65fde10cd4 100644 --- a/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js +++ b/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js @@ -11,7 +11,7 @@ import { import messages from './messages'; import ToolbarButton from './ToolbarButton'; import SchemaProvider from './SchemaProvider'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; import tagSVG from '@plone/volto/icons/tag.svg'; diff --git a/packages/volto-slate/src/utils/blocks.js b/packages/volto-slate/src/utils/blocks.js index 4175ebeddb..648314b6ce 100644 --- a/packages/volto-slate/src/utils/blocks.js +++ b/packages/volto-slate/src/utils/blocks.js @@ -4,8 +4,11 @@ import config from '@plone/volto/registry'; import { getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; -import _ from 'lodash'; +} from '@plone/volto/helpers/Blocks/Blocks'; +import find from 'lodash/find'; +import includes from 'lodash/includes'; +import some from 'lodash/some'; +import first from 'lodash/first'; import { makeEditor } from './editor'; // case sensitive; first in an inner array is the default and preffered format @@ -145,10 +148,10 @@ export const isSingleBlockTypeActive = (editor, format) => { }; export const isBlockActive = (editor, format) => { - const aliasList = _.find(formatAliases, (x) => _.includes(x, format)); + const aliasList = find(formatAliases, (x) => includes(x, format)); if (aliasList) { - const aliasFound = _.some(aliasList, (y) => { + const aliasFound = some(aliasList, (y) => { return isSingleBlockTypeActive(editor, y); }); @@ -163,17 +166,17 @@ export const isBlockActive = (editor, format) => { export const getBlockTypeContextData = (editor, format) => { let isActive, defaultFormat, matcher; - const aliasList = _.find(formatAliases, (x) => _.includes(x, format)); + const aliasList = find(formatAliases, (x) => includes(x, format)); if (aliasList) { - const aliasFound = _.some(aliasList, (y) => { + const aliasFound = some(aliasList, (y) => { return isSingleBlockTypeActive(editor, y); }); if (aliasFound) { isActive = true; - defaultFormat = _.first(aliasList); - matcher = (n) => _.includes(aliasList, n.type); + defaultFormat = first(aliasList); + matcher = (n) => includes(aliasList, n.type); return { isActive, defaultFormat, matcher }; } diff --git a/packages/volto-slate/src/utils/selection.js b/packages/volto-slate/src/utils/selection.js index 71e78b262d..8fea1e3824 100644 --- a/packages/volto-slate/src/utils/selection.js +++ b/packages/volto-slate/src/utils/selection.js @@ -1,7 +1,9 @@ -import { castArray, cloneDeep } from 'lodash'; +import castArray from 'lodash/castArray'; +import cloneDeep from 'lodash/cloneDeep'; import { Editor, Transforms, Range, Node } from 'slate'; import { ReactEditor } from 'slate-react'; -import { isCursorInList, makeEditor } from '@plone/volto-slate/utils'; +import { isCursorInList } from '@plone/volto-slate/utils/lists'; +import { makeEditor } from '@plone/volto-slate/utils/editor'; import { LI } from '@plone/volto-slate/constants'; import config from '@plone/volto/registry'; diff --git a/packages/volto-slate/src/utils/volto-blocks.js b/packages/volto-slate/src/utils/volto-blocks.js index 55367223e6..e01a40cc68 100644 --- a/packages/volto-slate/src/utils/volto-blocks.js +++ b/packages/volto-slate/src/utils/volto-blocks.js @@ -7,10 +7,10 @@ import { blockHasValue, getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; import { Transforms, Editor, Node, Text, Path } from 'slate'; import { serializeNodesToText } from '@plone/volto-slate/editor/render'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; import config from '@plone/volto/registry'; function fromEntries(pairs) { diff --git a/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx b/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx index ba7367ccd9..cdd37527ea 100644 --- a/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx +++ b/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx @@ -12,7 +12,7 @@ import { defineMessages, injectIntl } from 'react-intl'; 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'; +import { makeEditor } from '@plone/volto-slate/utils/editor'; import deserialize from '@plone/volto-slate/editor/deserialize'; import { diff --git a/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx b/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx index a97f3c28de..f736fd28af 100644 --- a/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx +++ b/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { Menu, Tab } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { ObjectWidget } from '@plone/volto/components/manage/Widgets'; export const ObjectByTypeWidget = (props) => { diff --git a/packages/volto/.eslintignore b/packages/volto/.eslintignore index a7c47537dc..4d8f67cb11 100644 --- a/packages/volto/.eslintignore +++ b/packages/volto/.eslintignore @@ -1 +1 @@ -types/ +/types/ diff --git a/packages/volto/.eslintrc b/packages/volto/.eslintrc index 9b98fbf685..992df17e6f 100644 --- a/packages/volto/.eslintrc +++ b/packages/volto/.eslintrc @@ -1,6 +1,12 @@ { - "extends": ["react-app", "prettier", "plugin:jsx-a11y/recommended"], + "extends": [ + "react-app", + "prettier", + "plugin:jsx-a11y/recommended", + "./.eslintrc.core.js", + ], "plugins": ["prettier", "react-hooks", "jsx-a11y"], + "root": true, "env": { "es6": true, "browser": true, @@ -18,6 +24,7 @@ }, "rules": { "import/no-unresolved": 1, + "import/named": "error", "react/jsx-key": [2, { "checkFragmentShorthand": true }], "no-alert": 1, "no-console": 1, diff --git a/packages/volto/.eslintrc.core.js b/packages/volto/.eslintrc.core.js new file mode 100644 index 0000000000..41cf953afe --- /dev/null +++ b/packages/volto/.eslintrc.core.js @@ -0,0 +1,42 @@ +/** This file is intended to have ESlint configuration only meant to be applied in + * Volto core. Since it relies on the `VOLTOCONFIG` environment variable, it will + * not be applied in CI and command line `make lint` in Volto projects. + * However, it will be applied in IDEs, adding a layer of convenience for developers, + * so they can adapt to use best practices and future deprecations and changes in + * Volto core codebase. + */ +let rules; + +if (process.env.VOLTOCONFIG) { + rules = null; +} else { + rules = { + 'no-restricted-imports': [ + 'warn', + { + name: '@plone/volto/components', + message: + 'Importing from barrel files is not allowed. The usage of barrel files is discouraged and they will be removed in Plone 7. Please use direct imports of the modules instead.', + }, + { + name: '@plone/volto/helpers', + message: + 'Importing from barrel files is not allowed. The usage of barrel files is discouraged and they will be removed in Plone 7. Please use direct imports of the modules instead.', + }, + { + name: '@plone/volto/actions', + message: + 'Importing from barrel files is not allowed. The usage of barrel files is discouraged and they will be removed in Plone 7. Please use direct imports of the modules instead.', + }, + { + name: 'lodash', + message: + "Importing directly from `lodash` is not allowed. Please use `import from 'lodash/'` instead.", + }, + ], + }; +} + +module.exports = { + ...(rules && { rules }), +}; diff --git a/packages/volto/news/6509.internal b/packages/volto/news/6509.internal new file mode 100644 index 0000000000..446507b2f0 --- /dev/null +++ b/packages/volto/news/6509.internal @@ -0,0 +1 @@ +Removed all imports from barrel files for components, actions, helpers, hooks and lodash. @pnicolli diff --git a/packages/volto/src/actions/content/content.js b/packages/volto/src/actions/content/content.js index fd97dfb89b..59f5da82ba 100644 --- a/packages/volto/src/actions/content/content.js +++ b/packages/volto/src/actions/content/content.js @@ -16,7 +16,7 @@ import { LINK_INTEGRITY_CHECK, UPDATE_UPLOADED_FILES, } from '@plone/volto/constants/ActionTypes'; -import { nestContent } from '@plone/volto/helpers'; +import { nestContent } from '@plone/volto/helpers/Content/Content'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/actions/language/language.js b/packages/volto/src/actions/language/language.js index 9e15fa6182..03cfe7e130 100644 --- a/packages/volto/src/actions/language/language.js +++ b/packages/volto/src/actions/language/language.js @@ -2,8 +2,8 @@ import { updateIntl } from 'react-intl-redux'; import { toGettextLang, toReactIntlLang, - getCookieOptions, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Utils/Utils'; +import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; import Cookies from 'universal-cookie'; export function changeLanguageCookies(language, req) { diff --git a/packages/volto/src/actions/search/search.js b/packages/volto/src/actions/search/search.js index 443a9d823e..7f886b9a23 100644 --- a/packages/volto/src/actions/search/search.js +++ b/packages/volto/src/actions/search/search.js @@ -3,7 +3,13 @@ * @module actions/search/search */ -import { compact, concat, isArray, join, map, pickBy, toPairs } from 'lodash'; +import compact from 'lodash/compact'; +import concat from 'lodash/concat'; +import isArray from 'lodash/isArray'; +import join from 'lodash/join'; +import map from 'lodash/map'; +import pickBy from 'lodash/pickBy'; +import toPairs from 'lodash/toPairs'; import { RESET_SEARCH_CONTENT, diff --git a/packages/volto/src/actions/workflow/workflow.js b/packages/volto/src/actions/workflow/workflow.js index 61bce4bc73..c413ee8f3b 100644 --- a/packages/volto/src/actions/workflow/workflow.js +++ b/packages/volto/src/actions/workflow/workflow.js @@ -8,7 +8,7 @@ import { GET_WORKFLOW_MULTIPLE, TRANSITION_WORKFLOW, } from '@plone/volto/constants/ActionTypes'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; /** * Get workflow function. diff --git a/packages/volto/src/components/manage/Actions/Actions.jsx b/packages/volto/src/components/manage/Actions/Actions.jsx index 9d063146c6..6cffac46f7 100644 --- a/packages/volto/src/components/manage/Actions/Actions.jsx +++ b/packages/volto/src/components/manage/Actions/Actions.jsx @@ -6,9 +6,14 @@ import { Dropdown, Icon } from 'semantic-ui-react'; import { toast } from 'react-toastify'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; -import { cut, copy, copyContent, moveContent } from '@plone/volto/actions'; -import { getBaseUrl } from '@plone/volto/helpers'; -import { Toast } from '@plone/volto/components'; +import { + cut, + copy, + copyContent, + moveContent, +} from '@plone/volto/actions/clipboard/clipboard'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { ContentsRenameModal } from '@plone/volto/components/manage/Contents'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Add/Add.jsx b/packages/volto/src/components/manage/Add/Add.jsx index 2dd9ea139a..1465fa2cbb 100644 --- a/packages/volto/src/components/manage/Add/Add.jsx +++ b/packages/volto/src/components/manage/Add/Add.jsx @@ -5,14 +5,10 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { - BodyClass, - Helmet, - extractInvariantErrors, -} from '@plone/volto/helpers'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { keys, isEmpty } from 'lodash'; +import keys from 'lodash/keys'; +import isEmpty from 'lodash/isEmpty'; import { defineMessages, injectIntl } from 'react-intl'; import { Button, Grid, Menu } from 'semantic-ui-react'; import { createPortal } from 'react-dom'; @@ -20,35 +16,39 @@ import { v4 as uuid } from 'uuid'; import qs from 'query-string'; import { toast } from 'react-toastify'; -import { - createContent, - getSchema, - changeLanguage, - setFormData, -} from '@plone/volto/actions'; -import { - Icon, - Toolbar, - Sidebar, - Toast, - TranslationObject, -} from '@plone/volto/components'; +import { createContent } from '@plone/volto/actions/content/content'; +import { getSchema } from '@plone/volto/actions/schema/schema'; +import { changeLanguage } from '@plone/volto/actions/language/language'; +import { setFormData } from '@plone/volto/actions/form/form'; + +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Sidebar from '@plone/volto/components/manage/Sidebar/Sidebar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import TranslationObject from '@plone/volto/components/manage/Multilingual/TranslationObject'; import { Form } from '@plone/volto/components/manage/Form'; + +import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { - getBaseUrl, hasBlocksData, - flattenToAppURL, getBlocksFieldname, getBlocksLayoutFieldname, - getLanguageIndependentFields, - langmap, - toGettextLang, +} from '@plone/volto/helpers/Blocks/Blocks'; +import { getLanguageIndependentFields } from '@plone/volto/helpers/Content/Content'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; +import { toGettextLang } from '@plone/volto/helpers/Utils/Utils'; +import { getSimpleDefaultBlocks, getDefaultBlocks, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/defaultBlocks'; +import { + tryParseJSON, + extractInvariantErrors, +} from '@plone/volto/helpers/FormValidation/FormValidation'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { preloadLazyLibs } from '@plone/volto/helpers/Loadable'; -import { tryParseJSON } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Aliases/Aliases.jsx b/packages/volto/src/components/manage/Aliases/Aliases.jsx index 3882c953d5..29f6748719 100644 --- a/packages/volto/src/components/manage/Aliases/Aliases.jsx +++ b/packages/volto/src/components/manage/Aliases/Aliases.jsx @@ -4,11 +4,11 @@ */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Helmet } from '@plone/volto/helpers'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; import { createPortal } from 'react-dom'; +import { toast } from 'react-toastify'; import { Button, Checkbox, @@ -24,15 +24,17 @@ import { removeAliases, addAliases, getAliases, - getContent, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/aliases/aliases'; +import { getContent } from '@plone/volto/actions/content/content'; + +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; -import { Icon, Toolbar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import backSVG from '@plone/volto/icons/back.svg'; -import { getBaseUrl } from '@plone/volto/helpers'; -import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; const messages = defineMessages({ back: { diff --git a/packages/volto/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx b/packages/volto/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx index 306865b763..485440d26b 100644 --- a/packages/volto/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +++ b/packages/volto/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx @@ -6,17 +6,17 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { compose } from 'redux'; - -// import unionClassNames from 'union-class-names'; +import { withRouter } from 'react-router'; import cx from 'classnames'; + import { addAppURL, isInternalURL, flattenToAppURL, URLUtils, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Url/Url'; -import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib'; +import doesNodeContainClick from 'semantic-ui-react/dist/commonjs/lib/doesNodeContainClick'; import { Input, Form, Button } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; @@ -25,10 +25,8 @@ import navTreeSVG from '@plone/volto/icons/nav.svg'; import aheadSVG from '@plone/volto/icons/ahead.svg'; import linkSVG from '@plone/volto/icons/link.svg'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; -import { withRouter } from 'react-router'; - -import { Icon } from '@plone/volto/components'; const messages = defineMessages({ placeholder: { diff --git a/packages/volto/src/components/manage/AnchorPlugin/useLinkEditor.jsx b/packages/volto/src/components/manage/AnchorPlugin/useLinkEditor.jsx index 75deb43990..6c1d748f65 100644 --- a/packages/volto/src/components/manage/AnchorPlugin/useLinkEditor.jsx +++ b/packages/volto/src/components/manage/AnchorPlugin/useLinkEditor.jsx @@ -13,7 +13,7 @@ */ import React from 'react'; -import { PositionedToolbar } from '@plone/volto-slate/editor/ui'; +import PositionedToolbar from '@plone/volto-slate/editor/ui/PositionedToolbar'; import AddLinkForm from '@plone/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm'; function getPositionStyle(position) { diff --git a/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx b/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx index 2ae878e5ba..e72672555b 100644 --- a/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx +++ b/packages/volto/src/components/manage/BlockChooser/BlockChooser.jsx @@ -1,10 +1,13 @@ import React from 'react'; -import { useUser } from '@plone/volto/hooks'; +import useUser from '@plone/volto/hooks/user/useUser'; import PropTypes from 'prop-types'; -import { filter, map, groupBy, isEmpty } from 'lodash'; +import filter from 'lodash/filter'; +import map from 'lodash/map'; +import groupBy from 'lodash/groupBy'; +import isEmpty from 'lodash/isEmpty'; import { Accordion, Button } from 'semantic-ui-react'; import { useIntl, defineMessages } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import AnimateHeight from 'react-animate-height'; import config from '@plone/volto/registry'; import upSVG from '@plone/volto/icons/up-key.svg'; diff --git a/packages/volto/src/components/manage/BlockChooser/BlockChooserButton.jsx b/packages/volto/src/components/manage/BlockChooser/BlockChooserButton.jsx index 136b413b70..d75055f375 100644 --- a/packages/volto/src/components/manage/BlockChooser/BlockChooserButton.jsx +++ b/packages/volto/src/components/manage/BlockChooser/BlockChooserButton.jsx @@ -1,8 +1,9 @@ import React from 'react'; -import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib'; +import doesNodeContainClick from 'semantic-ui-react/dist/commonjs/lib/doesNodeContainClick'; import addSVG from '@plone/volto/icons/circle-plus.svg'; -import { blockHasValue } from '@plone/volto/helpers'; -import { Icon, BlockChooser } from '@plone/volto/components'; +import { blockHasValue } from '@plone/volto/helpers/Blocks/Blocks'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import BlockChooser from '@plone/volto/components/manage/BlockChooser/BlockChooser'; import config from '@plone/volto/registry'; import { Button, Ref } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; diff --git a/packages/volto/src/components/manage/BlockChooser/BlockChooserSearch.jsx b/packages/volto/src/components/manage/BlockChooser/BlockChooserSearch.jsx index 73875ea0e7..b76ff49ffe 100644 --- a/packages/volto/src/components/manage/BlockChooser/BlockChooserSearch.jsx +++ b/packages/volto/src/components/manage/BlockChooser/BlockChooserSearch.jsx @@ -1,6 +1,6 @@ import React, { useRef } from 'react'; import { Button, Form, Input } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { defineMessages, useIntl } from 'react-intl'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx index 65d3f6fb0d..a8fd1e7c05 100644 --- a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx @@ -1,16 +1,15 @@ import React, { useEffect, useState } from 'react'; import { useIntl } from 'react-intl'; -import { cloneDeep, map } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; +import map from 'lodash/map'; import EditBlock from './Edit'; -import { DragDropList } from '@plone/volto/components'; +import DragDropList from '@plone/volto/components/manage/DragDropList/DragDropList'; import { getBlocks, getBlocksFieldname, getBlocksLayoutFieldname, applyBlockDefaults, getBlocksHierarchy, -} from '@plone/volto/helpers'; -import { addBlock, insertBlock, changeBlock, @@ -20,11 +19,13 @@ import { mutateBlock, nextBlockId, previousBlockId, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; +import { useDetectClickOutside } from '@plone/volto/helpers/Utils/useDetectClickOutside'; +import { useEvent } from '@plone/volto/helpers/Utils/useEvent'; import EditBlockWrapper from './EditBlockWrapper'; -import { setSidebarTab, setUIState } from '@plone/volto/actions'; +import { setSidebarTab } from '@plone/volto/actions/sidebar/sidebar'; +import { setUIState } from '@plone/volto/actions/form/form'; import { useDispatch } from 'react-redux'; -import { useDetectClickOutside, useEvent } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; import { createPortal } from 'react-dom'; diff --git a/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx b/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx index f8fab927af..2a4123bd38 100644 --- a/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/DefaultEdit.jsx @@ -1,7 +1,7 @@ import React from 'react'; import config from '@plone/volto/registry'; import { useIntl } from 'react-intl'; -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import DefaultBlockView from './DefaultView'; diff --git a/packages/volto/src/components/manage/Blocks/Block/DefaultView.jsx b/packages/volto/src/components/manage/Blocks/Block/DefaultView.jsx index c898e3676a..8092c95d3e 100644 --- a/packages/volto/src/components/manage/Blocks/Block/DefaultView.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/DefaultView.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Container, Segment, Grid, Label } from 'semantic-ui-react'; -import { ErrorBoundary } from '@plone/volto/components'; +import ErrorBoundary from '@plone/volto/components/theme/Error/ErrorBoundary'; import { getWidget } from '@plone/volto/helpers/Widget/utils'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Blocks/Block/Edit.jsx b/packages/volto/src/components/manage/Blocks/Block/Edit.jsx index 6812152587..da5d317777 100644 --- a/packages/volto/src/components/manage/Blocks/Block/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/Edit.jsx @@ -9,16 +9,15 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { defineMessages, injectIntl } from 'react-intl'; import cx from 'classnames'; -import { setSidebarTab, setUIState } from '@plone/volto/actions'; +import { setSidebarTab } from '@plone/volto/actions/sidebar/sidebar'; +import { setUIState } from '@plone/volto/actions/form/form'; import config from '@plone/volto/registry'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; -import { ViewDefaultBlock, EditDefaultBlock } from '@plone/volto/components'; - -import { - SidebarPortal, - BlockSettingsSidebar, - BlockSettingsSchema, -} from '@plone/volto/components'; +import ViewDefaultBlock from '@plone/volto/components/manage/Blocks/Block/DefaultView'; +import EditDefaultBlock from '@plone/volto/components/manage/Blocks/Block/DefaultEdit'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; +import BlockSettingsSidebar from '@plone/volto/components/manage/Blocks/Block/Settings'; +import BlockSettingsSchema from '@plone/volto/components/manage/Blocks/Block/Schema'; const messages = defineMessages({ unknownBlock: { diff --git a/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx b/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx index 3c94084860..3ef354708b 100644 --- a/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/EditBlockWrapper.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { applyBlockDefaults, applyBlockInitialValue, @@ -8,7 +8,7 @@ import { buildStyleClassNamesFromData, buildStyleObjectFromData, buildStyleClassNamesExtenders, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; import dragSVG from '@plone/volto/icons/drag.svg'; import { Button } from 'semantic-ui-react'; import includes from 'lodash/includes'; @@ -16,7 +16,7 @@ import isBoolean from 'lodash/isBoolean'; import { defineMessages, injectIntl } from 'react-intl'; import cx from 'classnames'; import config from '@plone/volto/registry'; -import { BlockChooserButton } from '@plone/volto/components'; +import BlockChooserButton from '@plone/volto/components/manage/BlockChooser/BlockChooserButton'; import trashSVG from '@plone/volto/icons/delete.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Block/Order/Item.jsx b/packages/volto/src/components/manage/Blocks/Block/Order/Item.jsx index 5580fc416f..f09233ee62 100644 --- a/packages/volto/src/components/manage/Blocks/Block/Order/Item.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/Order/Item.jsx @@ -1,10 +1,10 @@ import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; -import { includes } from 'lodash'; +import includes from 'lodash/includes'; import cx from 'classnames'; -import { Icon } from '@plone/volto/components'; -import { setUIState } from '@plone/volto/actions'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { setUIState } from '@plone/volto/actions/form/form'; import config from '@plone/volto/registry'; import deleteSVG from '@plone/volto/icons/delete.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Block/Order/Order.jsx b/packages/volto/src/components/manage/Blocks/Block/Order/Order.jsx index 7c17bba43a..bb8a2cedc6 100644 --- a/packages/volto/src/components/manage/Blocks/Block/Order/Order.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/Order/Order.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; -import { find, min } from 'lodash'; +import find from 'lodash/find'; +import min from 'lodash/min'; import { flattenTree, getProjection, removeChildrenOf } from './utilities'; import SortableItem from './SortableItem'; diff --git a/packages/volto/src/components/manage/Blocks/Block/Order/utilities.js b/packages/volto/src/components/manage/Blocks/Block/Order/utilities.js index eaa802ca65..fcc481d275 100644 --- a/packages/volto/src/components/manage/Blocks/Block/Order/utilities.js +++ b/packages/volto/src/components/manage/Blocks/Block/Order/utilities.js @@ -1,6 +1,6 @@ -import { isArray } from 'lodash'; +import isArray from 'lodash/isArray'; -import { getBlocksLayoutFieldname } from '@plone/volto/helpers'; +import { getBlocksLayoutFieldname } from '@plone/volto/helpers/Blocks/Blocks'; function getDragDepth(offset, indentationWidth) { return Math.round(offset / indentationWidth); diff --git a/packages/volto/src/components/manage/Blocks/Block/StyleWrapper.jsx b/packages/volto/src/components/manage/Blocks/Block/StyleWrapper.jsx index 3f94877a7d..18e36f8756 100644 --- a/packages/volto/src/components/manage/Blocks/Block/StyleWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/StyleWrapper.jsx @@ -4,7 +4,7 @@ import { buildStyleClassNamesFromData, buildStyleClassNamesExtenders, buildStyleObjectFromData, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; const StyleWrapper = (props) => { let classNames, diff --git a/packages/volto/src/components/manage/Blocks/Container/Edit.jsx b/packages/volto/src/components/manage/Blocks/Container/Edit.jsx index 7c1ce4d9d4..4e46b9e0b7 100644 --- a/packages/volto/src/components/manage/Blocks/Container/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/Edit.jsx @@ -1,14 +1,14 @@ import { useState } from 'react'; import { useIntl } from 'react-intl'; -import { pickBy } from 'lodash'; -import { SidebarPortal } from '@plone/volto/components'; +import pickBy from 'lodash/pickBy'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import { BlocksForm } from '@plone/volto/components/manage/Form'; import PropTypes from 'prop-types'; import ContainerData from './Data'; import DefaultEditBlockWrapper from './EditBlockWrapper'; import SimpleContainerToolbar from './SimpleContainerToolbar'; import { v4 as uuid } from 'uuid'; -import { blocksFormGenerator } from '@plone/volto/helpers'; +import { blocksFormGenerator } from '@plone/volto/helpers/Blocks/Blocks'; import DefaultTemplateChooser from '@plone/volto/components/manage/TemplateChooser/TemplateChooser'; diff --git a/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx b/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx index 62e2c1a6eb..20d22753a6 100644 --- a/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx @@ -1,9 +1,9 @@ -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; import NewBlockAddButton from './NewBlockAddButton'; import cx from 'classnames'; -import { isInteractiveElement } from '@plone/volto/helpers'; +import { isInteractiveElement } from '@plone/volto/helpers/Utils/Utils'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Container/NewBlockAddButton.jsx b/packages/volto/src/components/manage/Blocks/Container/NewBlockAddButton.jsx index 713f518e22..80965d6dad 100644 --- a/packages/volto/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/NewBlockAddButton.jsx @@ -1,8 +1,9 @@ import React from 'react'; import { Button, Ref } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; -import { BlockChooser, Icon } from '@plone/volto/components'; -import { useDetectClickOutside } from '@plone/volto/helpers'; +import BlockChooser from '@plone/volto/components/manage/BlockChooser/BlockChooser'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { useDetectClickOutside } from '@plone/volto/helpers/Utils/useDetectClickOutside'; import addSVG from '@plone/volto/icons/add.svg'; import { usePopper } from 'react-popper'; import { createPortal } from 'react-dom'; diff --git a/packages/volto/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx b/packages/volto/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx index 2525e4d48f..7bc0c14a2a 100644 --- a/packages/volto/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/SimpleContainerToolbar.jsx @@ -1,6 +1,6 @@ import { defineMessages, useIntl } from 'react-intl'; import { Button } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import addSVG from '@plone/volto/icons/add.svg'; import configSVG from '@plone/volto/icons/configuration.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Grid/Edit.jsx b/packages/volto/src/components/manage/Blocks/Grid/Edit.jsx index 4c15f26881..44ba616d5c 100644 --- a/packages/volto/src/components/manage/Blocks/Grid/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Grid/Edit.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import cx from 'classnames'; import ContainerEdit from '../Container/Edit'; import { useDispatch, useSelector } from 'react-redux'; -import { setUIState } from '@plone/volto/actions'; +import { setUIState } from '@plone/volto/actions/form/form'; const GridBlockEdit = (props) => { const { data } = props; diff --git a/packages/volto/src/components/manage/Blocks/Grid/View.jsx b/packages/volto/src/components/manage/Blocks/Grid/View.jsx index 1be481253c..e052ae0558 100644 --- a/packages/volto/src/components/manage/Blocks/Grid/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Grid/View.jsx @@ -1,7 +1,7 @@ import { Grid } from 'semantic-ui-react'; import cx from 'classnames'; -import { RenderBlocks } from '@plone/volto/components'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import config from '@plone/volto/registry'; const GridBlockView = (props) => { diff --git a/packages/volto/src/components/manage/Blocks/Grid/templates.js b/packages/volto/src/components/manage/Blocks/Grid/templates.js index f1b54facaa..fcd5dbe3d2 100644 --- a/packages/volto/src/components/manage/Blocks/Grid/templates.js +++ b/packages/volto/src/components/manage/Blocks/Grid/templates.js @@ -1,5 +1,5 @@ import { defineMessages } from 'react-intl'; -import { blocksFormGenerator } from '@plone/volto/helpers'; +import { blocksFormGenerator } from '@plone/volto/helpers/Blocks/Blocks'; import gridTemplate1 from './grid-1.svg'; import gridTemplate2 from './grid-2.svg'; diff --git a/packages/volto/src/components/manage/Blocks/HTML/Edit.jsx b/packages/volto/src/components/manage/Blocks/HTML/Edit.jsx index 4cb63c3193..7427dde32b 100644 --- a/packages/volto/src/components/manage/Blocks/HTML/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/HTML/Edit.jsx @@ -9,9 +9,9 @@ import PropTypes from 'prop-types'; import { Button, Popup } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; import loadable from '@loadable/component'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import showSVG from '@plone/volto/icons/show.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Image/Edit.jsx b/packages/volto/src/components/manage/Blocks/Image/Edit.jsx index 6483a8846d..7451b9cbd1 100644 --- a/packages/volto/src/components/manage/Blocks/Image/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Image/Edit.jsx @@ -5,13 +5,11 @@ import React from 'react'; import cx from 'classnames'; -import { ImageSidebar, SidebarPortal } from '@plone/volto/components'; +import ImageSidebar from '@plone/volto/components/manage/Blocks/Image/ImageSidebar'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; -import { - flattenToAppURL, - isInternalURL, - withBlockExtensions, -} from '@plone/volto/helpers'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import config from '@plone/volto/registry'; import { ImageInput } from '@plone/volto/components/manage/Widgets/ImageWidget'; diff --git a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx index dd35733475..040625384a 100644 --- a/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx +++ b/packages/volto/src/components/manage/Blocks/Image/ImageSidebar.jsx @@ -2,8 +2,9 @@ import React from 'react'; 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 { Icon, Image } from '@plone/volto/components'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Image from '@plone/volto/components/theme/Image/Image'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import { ImageSchema } from './schema'; import imageSVG from '@plone/volto/icons/image.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Image/View.jsx b/packages/volto/src/components/manage/Blocks/Image/View.jsx index e84dc64c14..eaf6137657 100644 --- a/packages/volto/src/components/manage/Blocks/Image/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Image/View.jsx @@ -1,12 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import cx from 'classnames'; -import { - flattenToAppURL, - isInternalURL, - withBlockExtensions, -} from '@plone/volto/helpers'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import config from '@plone/volto/registry'; export const View = ({ className, data, detached, properties, style }) => { diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx index 70320abf7d..9aa0fb2907 100644 --- a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx @@ -4,7 +4,8 @@ import { defineMessages, useIntl } from 'react-intl'; import cx from 'classnames'; import { Message } from 'semantic-ui-react'; -import { LeadImageSidebar, SidebarPortal } from '@plone/volto/components'; +import LeadImageSidebar from '@plone/volto/components/manage/Blocks/LeadImage/LeadImageSidebar'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import config from '@plone/volto/registry'; import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg'; diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx index 5a126ec2cc..3481da6bd7 100644 --- a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +++ b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx @@ -3,12 +3,13 @@ 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 Icon from '@plone/volto/components/theme/Icon/Icon'; +import Image from '@plone/volto/components/theme/Image/Image'; import { CheckboxWidget, TextWidget, } from '@plone/volto/components/manage/Widgets'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import AlignBlock from '@plone/volto/components/manage/Sidebar/AlignBlock'; import imageSVG from '@plone/volto/icons/image.svg'; diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/View.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/View.jsx index aa1cfa9bdf..41920fa76a 100644 --- a/packages/volto/src/components/manage/Blocks/LeadImage/View.jsx +++ b/packages/volto/src/components/manage/Blocks/LeadImage/View.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import cx from 'classnames'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Blocks/Listing/DefaultTemplate.jsx b/packages/volto/src/components/manage/Blocks/Listing/DefaultTemplate.jsx index 8585931340..f4ae527f18 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/DefaultTemplate.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/DefaultTemplate.jsx @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { ConditionalLink, UniversalLink } from '@plone/volto/components'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { isInternalURL } from '@plone/volto/helpers/Url/Url'; +import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; const DefaultTemplate = ({ headlineTag, diff --git a/packages/volto/src/components/manage/Blocks/Listing/Edit.jsx b/packages/volto/src/components/manage/Blocks/Listing/Edit.jsx index 29fefe54cc..2ccbf80d02 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/Edit.jsx @@ -1,16 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, useIntl } from 'react-intl'; -import { isEqual } from 'lodash'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import isEqual from 'lodash/isEqual'; -import { - SidebarPortal, - ListingBlockBody as ListingBody, -} from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; +import { default as ListingBody } from '@plone/volto/components/manage/Blocks/Listing/ListingBody'; import ListingData from './ListingData'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; const messages = defineMessages({ results: { diff --git a/packages/volto/src/components/manage/Blocks/Listing/ImageGallery.jsx b/packages/volto/src/components/manage/Blocks/Listing/ImageGallery.jsx index 60dd7cb36f..ca18bf100c 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/ImageGallery.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/ImageGallery.jsx @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import loadable from '@loadable/component'; import 'react-image-gallery/styles/css/image-gallery.css'; import { Button } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; import galleryLeftSVG from '@plone/volto/icons/left-key.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Listing/ListingBody.jsx b/packages/volto/src/components/manage/Blocks/Listing/ListingBody.jsx index 3d874d861c..036ccdfd76 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/ListingBody.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/ListingBody.jsx @@ -3,11 +3,11 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import cx from 'classnames'; import { Pagination, Dimmer, Loader } from 'semantic-ui-react'; import Slugger from 'github-slugger'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { renderLinkElement } from '@plone/volto-slate/editor/render'; import config from '@plone/volto/registry'; import withQuerystringResults from './withQuerystringResults'; -import { normalizeString } from '@plone/volto/helpers'; +import { normalizeString } from '@plone/volto/helpers/Utils/Utils'; import paginationLeftSVG from '@plone/volto/icons/left-key.svg'; import paginationRightSVG from '@plone/volto/icons/right-key.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Listing/SummaryTemplate.jsx b/packages/volto/src/components/manage/Blocks/Listing/SummaryTemplate.jsx index be78518d7c..8ae91a3d7b 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/SummaryTemplate.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/SummaryTemplate.jsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { ConditionalLink, Component } from '@plone/volto/components'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; +import Component from '@plone/volto/components/theme/Component/Component'; -import { isInternalURL } from '@plone/volto/helpers/Url/Url'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; const SummaryTemplate = ({ items, linkTitle, linkHref, isEditMode }) => { let link = null; diff --git a/packages/volto/src/components/manage/Blocks/Listing/View.jsx b/packages/volto/src/components/manage/Blocks/Listing/View.jsx index dc31dc16ea..26ea59e448 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/View.jsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; -import { ListingBlockBody as ListingBody } from '@plone/volto/components'; +import { default as ListingBody } from '@plone/volto/components/manage/Blocks/Listing/ListingBody'; const View = (props) => { const { data, path, pathname, className, style } = props; diff --git a/packages/volto/src/components/manage/Blocks/Listing/getAsyncData.js b/packages/volto/src/components/manage/Blocks/Listing/getAsyncData.js index e7c4996cc5..2bfa625284 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/getAsyncData.js +++ b/packages/volto/src/components/manage/Blocks/Listing/getAsyncData.js @@ -1,5 +1,5 @@ -import { getQueryStringResults } from '@plone/volto/actions'; -import { resolveBlockExtensions } from '@plone/volto/helpers'; +import { getQueryStringResults } from '@plone/volto/actions/querystringsearch/querystringsearch'; +import { resolveBlockExtensions } from '@plone/volto/helpers/Extensions'; import qs from 'query-string'; import { slugify } from '@plone/volto/helpers/Utils/Utils'; diff --git a/packages/volto/src/components/manage/Blocks/Listing/withQuerystringResults.jsx b/packages/volto/src/components/manage/Blocks/Listing/withQuerystringResults.jsx index 08c7bdeb6b..6df439e3e9 100644 --- a/packages/volto/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +++ b/packages/volto/src/components/manage/Blocks/Listing/withQuerystringResults.jsx @@ -3,8 +3,10 @@ import { useDispatch, useSelector } from 'react-redux'; import hoistNonReactStatics from 'hoist-non-react-statics'; import useDeepCompareEffect from 'use-deep-compare-effect'; -import { getContent, getQueryStringResults } from '@plone/volto/actions'; -import { usePagination, getBaseUrl } from '@plone/volto/helpers'; +import { getContent } from '@plone/volto/actions/content/content'; +import { getQueryStringResults } from '@plone/volto/actions/querystringsearch/querystringsearch'; +import { usePagination } from '@plone/volto/helpers/Utils/usePagination'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Blocks/Maps/Edit.jsx b/packages/volto/src/components/manage/Blocks/Maps/Edit.jsx index c2a0763659..f2519ca747 100644 --- a/packages/volto/src/components/manage/Blocks/Maps/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Maps/Edit.jsx @@ -3,9 +3,11 @@ import PropTypes from 'prop-types'; import { Button, Input, Message } from 'semantic-ui-react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import cx from 'classnames'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import { compose } from 'redux'; -import { Icon, SidebarPortal, MapsSidebar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; +import MapsSidebar from '@plone/volto/components/manage/Blocks/Maps/MapsSidebar'; import clearSVG from '@plone/volto/icons/clear.svg'; import aheadSVG from '@plone/volto/icons/ahead.svg'; import mapsBlockSVG from '@plone/volto/components/manage/Blocks/Maps/block-maps.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx index 977b7dc870..9c5ae50070 100644 --- a/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx +++ b/packages/volto/src/components/manage/Blocks/Maps/MapsSidebar.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { MapsSchema } from './schema'; import { useIntl, defineMessages } from 'react-intl'; import globeSVG from '@plone/volto/icons/globe.svg'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import { Segment } from 'semantic-ui-react'; diff --git a/packages/volto/src/components/manage/Blocks/Maps/View.jsx b/packages/volto/src/components/manage/Blocks/Maps/View.jsx index 12f26abcc5..816a040067 100644 --- a/packages/volto/src/components/manage/Blocks/Maps/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Maps/View.jsx @@ -8,7 +8,7 @@ import { injectIntl } from 'react-intl'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { compose } from 'redux'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; /** * View image block class. diff --git a/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx b/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx index 56ac5769e4..f70780133f 100644 --- a/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/SearchBlockEdit.jsx @@ -2,16 +2,16 @@ import React, { useEffect } from 'react'; import { defineMessages } from 'react-intl'; import { compose } from 'redux'; -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import { addExtensionFieldToSchema } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; import { SearchBlockViewComponent } from './SearchBlockView'; import Schema from './schema'; import { withSearch, withQueryString } from './hocs'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; const messages = defineMessages({ template: { diff --git a/packages/volto/src/components/manage/Blocks/Search/SearchBlockView.jsx b/packages/volto/src/components/manage/Blocks/Search/SearchBlockView.jsx index 908342de8c..adf618a166 100644 --- a/packages/volto/src/components/manage/Blocks/Search/SearchBlockView.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/SearchBlockView.jsx @@ -1,14 +1,15 @@ import React from 'react'; import ListingBody from '@plone/volto/components/manage/Blocks/Listing/ListingBody'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import config from '@plone/volto/registry'; import { withSearch, withQueryString } from './hocs'; import { compose } from 'redux'; import { useSelector } from 'react-redux'; -import { isEqual, isFunction } from 'lodash'; +import isEqual from 'lodash/isEqual'; +import isFunction from 'lodash/isFunction'; import cx from 'classnames'; const getListingBodyVariation = (data) => { diff --git a/packages/volto/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx b/packages/volto/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx index 780944c5cd..b62f3cb15e 100644 --- a/packages/volto/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/components/DateRangeFacet.jsx @@ -3,7 +3,7 @@ import { Header } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { compose } from 'redux'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { connect } from 'react-redux'; diff --git a/packages/volto/src/components/manage/Blocks/Search/components/FilterList.jsx b/packages/volto/src/components/manage/Blocks/Search/components/FilterList.jsx index a10e49907d..eb7497134d 100644 --- a/packages/volto/src/components/manage/Blocks/Search/components/FilterList.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/components/FilterList.jsx @@ -1,10 +1,10 @@ import React from 'react'; import { Accordion, Button, Icon } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; -import { Icon as VoltoIcon } from '@plone/volto/components'; -import { resolveExtension } from '@plone/volto/helpers'; +import { default as VoltoIcon } from '@plone/volto/components/theme/Icon/Icon'; +import { resolveExtension } from '@plone/volto/helpers/Extensions'; import config from '@plone/volto/registry'; import downSVG from '@plone/volto/icons/down-key.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Search/components/SearchInput.jsx b/packages/volto/src/components/manage/Blocks/Search/components/SearchInput.jsx index 1640dd08f0..0c000579f8 100644 --- a/packages/volto/src/components/manage/Blocks/Search/components/SearchInput.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/components/SearchInput.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { Button, Input } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import loupeSVG from '@plone/volto/icons/zoom.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Search/components/SortOn.jsx b/packages/volto/src/components/manage/Blocks/Search/components/SortOn.jsx index 08d268969b..dec213bacf 100644 --- a/packages/volto/src/components/manage/Blocks/Search/components/SortOn.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/components/SortOn.jsx @@ -2,7 +2,7 @@ import { Button } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; import cx from 'classnames'; import { compose } from 'redux'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Option, DropdownIndicator, diff --git a/packages/volto/src/components/manage/Blocks/Search/components/base.js b/packages/volto/src/components/manage/Blocks/Search/components/base.js index c196e2fe02..911e70e274 100644 --- a/packages/volto/src/components/manage/Blocks/Search/components/base.js +++ b/packages/volto/src/components/manage/Blocks/Search/components/base.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; /** * Converts the state (extracted from URL) to options for the facet control diff --git a/packages/volto/src/components/manage/Blocks/Search/hocs/withQueryString.jsx b/packages/volto/src/components/manage/Blocks/Search/hocs/withQueryString.jsx index c6bc7508d9..f9a97648a3 100644 --- a/packages/volto/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/hocs/withQueryString.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { getQuerystring } from '@plone/volto/actions'; +import { getQuerystring } from '@plone/volto/actions/querystring/querystring'; function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || 'Component'; diff --git a/packages/volto/src/components/manage/Blocks/Search/hocs/withSearch.jsx b/packages/volto/src/components/manage/Blocks/Search/hocs/withSearch.jsx index 6fa019b6b9..232451d271 100644 --- a/packages/volto/src/components/manage/Blocks/Search/hocs/withSearch.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/hocs/withSearch.jsx @@ -5,8 +5,8 @@ import { useLocation, useHistory } from 'react-router-dom'; import { resolveExtension } from '@plone/volto/helpers/Extensions/withBlockExtensions'; import config from '@plone/volto/registry'; -import { usePrevious } from '@plone/volto/helpers'; -import { isEqual } from 'lodash'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import isEqual from 'lodash/isEqual'; function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || 'Component'; diff --git a/packages/volto/src/components/manage/Blocks/Search/schema.js b/packages/volto/src/components/manage/Blocks/Search/schema.js index 5686a3a094..a75232fc6b 100644 --- a/packages/volto/src/components/manage/Blocks/Search/schema.js +++ b/packages/volto/src/components/manage/Blocks/Search/schema.js @@ -1,6 +1,6 @@ import config from '@plone/volto/registry'; import { defineMessages } from 'react-intl'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import { hasNonValueOperation, hasDateOperation } from './utils'; const messages = defineMessages({ 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 1b4f9a6841..ba8a80b183 100644 --- a/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +++ b/packages/volto/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx @@ -3,7 +3,10 @@ * @module components/manage/Widgets/SelectWidget */ -import { map, filter, toPairs, groupBy } from 'lodash'; +import map from 'lodash/map'; +import filter from 'lodash/filter'; +import toPairs from 'lodash/toPairs'; +import groupBy from 'lodash/groupBy'; import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; diff --git a/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx b/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx index 69bb3db42a..73bf7a8719 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx +++ b/packages/volto/src/components/manage/Blocks/Teaser/Data.jsx @@ -3,14 +3,13 @@ import { useDispatch } from 'react-redux'; import { defineMessages, useIntl } from 'react-intl'; import { Button } from 'semantic-ui-react'; import { toast } from 'react-toastify'; -import { Icon, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; -import { - flattenToAppURL, - messages as defaultMessages, -} from '@plone/volto/helpers'; -import { getContent } from '@plone/volto/actions'; -import { isEmpty } from 'lodash'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { messages as defaultMessages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { getContent } from '@plone/volto/actions/content/content'; +import isEmpty from 'lodash/isEmpty'; import reloadSVG from '@plone/volto/icons/reload.svg'; import trashSVG from '@plone/volto/icons/delete.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Teaser/DefaultBody.jsx b/packages/volto/src/components/manage/Blocks/Teaser/DefaultBody.jsx index 0ec4a26fdc..aa1bb7a1ba 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/DefaultBody.jsx +++ b/packages/volto/src/components/manage/Blocks/Teaser/DefaultBody.jsx @@ -3,9 +3,9 @@ import PropTypes from 'prop-types'; import { Message } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg'; -import { isInternalURL } from '@plone/volto/helpers'; -import { MaybeWrap } from '@plone/volto/components'; -import { UniversalLink } from '@plone/volto/components'; +import { isInternalURL } from '@plone/volto/helpers/Url/Url'; +import MaybeWrap from '@plone/volto/components/manage/MaybeWrap/MaybeWrap'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import cx from 'classnames'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Blocks/Teaser/Edit.jsx b/packages/volto/src/components/manage/Blocks/Teaser/Edit.jsx index 64961374e0..c279ba956a 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Teaser/Edit.jsx @@ -1,8 +1,8 @@ import React from 'react'; import TeaserBody from './Body'; -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import TeaserData from './Data'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; const TeaserEdit = (props) => { const { data, onChangeBlock, block, selected } = props; diff --git a/packages/volto/src/components/manage/Blocks/Teaser/View.jsx b/packages/volto/src/components/manage/Blocks/Teaser/View.jsx index 253be5b364..10f1ea96ee 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Teaser/View.jsx @@ -1,6 +1,6 @@ import React from 'react'; import TeaserBody from './Body'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; const TeaserView = (props) => { return ; diff --git a/packages/volto/src/components/manage/Blocks/Teaser/adapter.js b/packages/volto/src/components/manage/Blocks/Teaser/adapter.js index 4f01bad5ef..ad9e761126 100644 --- a/packages/volto/src/components/manage/Blocks/Teaser/adapter.js +++ b/packages/volto/src/components/manage/Blocks/Teaser/adapter.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; export const TeaserBlockDataAdapter = ({ block, diff --git a/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx b/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx index f8bf6f453f..bb73fbc5b2 100644 --- a/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/ToC/Edit.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import { SidebarPortal } from '@plone/volto/components'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import TableOfContentsSchema from './Schema'; diff --git a/packages/volto/src/components/manage/Blocks/ToC/View.jsx b/packages/volto/src/components/manage/Blocks/ToC/View.jsx index 80596cd499..3f5ebc2ca8 100644 --- a/packages/volto/src/components/manage/Blocks/ToC/View.jsx +++ b/packages/volto/src/components/manage/Blocks/ToC/View.jsx @@ -8,12 +8,12 @@ import { FormattedMessage } from 'react-intl'; import cx from 'classnames'; import { Message } from 'semantic-ui-react'; import config from '@plone/volto/registry'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import { getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; export const getBlocksTocEntries = (properties, tocData) => { const blocksFieldName = getBlocksFieldname(properties); diff --git a/packages/volto/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx b/packages/volto/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx index 484a36c599..57965d3eef 100644 --- a/packages/volto/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +++ b/packages/volto/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx @@ -4,11 +4,11 @@ */ import PropTypes from 'prop-types'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { List } from 'semantic-ui-react'; import Slugger from 'github-slugger'; -import { UniversalLink } from '@plone/volto/components'; -import { normalizeString } from '@plone/volto/helpers'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import { normalizeString } from '@plone/volto/helpers/Utils/Utils'; const RenderListItems = ({ items, data }) => { return map(items, (item) => { diff --git a/packages/volto/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx b/packages/volto/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx index 29c782ae92..535482763f 100644 --- a/packages/volto/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +++ b/packages/volto/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx @@ -1,10 +1,10 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { Menu, Dropdown } from 'semantic-ui-react'; import AnchorLink from 'react-anchor-link-smooth-scroll'; import Slugger from 'github-slugger'; -import { normalizeString } from '@plone/volto/helpers'; +import { normalizeString } from '@plone/volto/helpers/Utils/Utils'; const RenderMenuItems = ({ items }) => { return map(items, (item) => { diff --git a/packages/volto/src/components/manage/Blocks/Video/Body.jsx b/packages/volto/src/components/manage/Blocks/Video/Body.jsx index f03569d563..781345018a 100644 --- a/packages/volto/src/components/manage/Blocks/Video/Body.jsx +++ b/packages/volto/src/components/manage/Blocks/Video/Body.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Embed, Message } from 'semantic-ui-react'; import cx from 'classnames'; -import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers'; +import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers/Url/Url'; //Extracting videoID, listID and thumbnailURL from the video URL const getVideoIDAndPlaceholder = (url) => { diff --git a/packages/volto/src/components/manage/Blocks/Video/Edit.jsx b/packages/volto/src/components/manage/Blocks/Video/Edit.jsx index 7265eba255..0745ff3b56 100644 --- a/packages/volto/src/components/manage/Blocks/Video/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/Video/Edit.jsx @@ -4,12 +4,14 @@ import { defineMessages, useIntl } from 'react-intl'; import { Button, Input, Message } from 'semantic-ui-react'; import cx from 'classnames'; -import { Icon, SidebarPortal, VideoSidebar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal'; +import VideoSidebar from '@plone/volto/components/manage/Blocks/Video/VideoSidebar'; import clearSVG from '@plone/volto/icons/clear.svg'; import aheadSVG from '@plone/volto/icons/ahead.svg'; import videoBlockSVG from '@plone/volto/components/manage/Blocks/Video/block-video.svg'; import Body from '@plone/volto/components/manage/Blocks/Video/Body'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; const messages = defineMessages({ VideoFormDescription: { diff --git a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx index bec7228200..7d4541477f 100644 --- a/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx +++ b/packages/volto/src/components/manage/Blocks/Video/VideoSidebar.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { VideoBlockSchema } from './schema'; import { Segment } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { BlockDataForm } from '@plone/volto/components/manage/Form'; import videoSVG from '@plone/volto/icons/videocamera.svg'; diff --git a/packages/volto/src/components/manage/Blocks/Video/View.jsx b/packages/volto/src/components/manage/Blocks/Video/View.jsx index 835be20e6a..96b138dbc6 100644 --- a/packages/volto/src/components/manage/Blocks/Video/View.jsx +++ b/packages/volto/src/components/manage/Blocks/Video/View.jsx @@ -6,7 +6,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import Body from '@plone/volto/components/manage/Blocks/Video/Body'; -import { withBlockExtensions } from '@plone/volto/helpers'; +import { withBlockExtensions } from '@plone/volto/helpers/Extensions'; import cx from 'classnames'; /** diff --git a/packages/volto/src/components/manage/ConditionalLink/ConditionalLink.jsx b/packages/volto/src/components/manage/ConditionalLink/ConditionalLink.jsx index 664470f486..be45c1cf7d 100644 --- a/packages/volto/src/components/manage/ConditionalLink/ConditionalLink.jsx +++ b/packages/volto/src/components/manage/ConditionalLink/ConditionalLink.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import PropTypes from 'prop-types'; const ConditionalLink = ({ condition, to, item, ...props }) => { diff --git a/packages/volto/src/components/manage/Contents/Contents.jsx b/packages/volto/src/components/manage/Contents/Contents.jsx index 20de9fc406..d7a000f8d4 100644 --- a/packages/volto/src/components/manage/Contents/Contents.jsx +++ b/packages/volto/src/components/manage/Contents/Contents.jsx @@ -22,44 +22,42 @@ import { Loader, Dimmer, } from 'semantic-ui-react'; -import { - concat, - filter, - find, - indexOf, - keys, - map, - mapValues, - pull, -} from 'lodash'; +import concat from 'lodash/concat'; +import filter from 'lodash/filter'; +import find from 'lodash/find'; +import indexOf from 'lodash/indexOf'; +import keys from 'lodash/keys'; +import map from 'lodash/map'; +import mapValues from 'lodash/mapValues'; +import pull from 'lodash/pull'; import move from 'lodash-move'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { asyncConnect } from '@plone/volto/helpers'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { searchContent } from '@plone/volto/actions/search/search'; import { - searchContent, - cut, - copy, - copyContent, deleteContent, - listActions, - moveContent, orderContent, sortContent, updateColumnsContent, linkIntegrityCheck, getContent, -} from '@plone/volto/actions'; -import Indexes, { defaultIndexes } from '@plone/volto/constants/Indexes'; +} from '@plone/volto/actions/content/content'; import { - Pagination, - Popup, - Toolbar, - Toast, - Icon, - Unauthorized, -} from '@plone/volto/components'; + copyContent, + moveContent, + cut, + copy, +} from '@plone/volto/actions/clipboard/clipboard'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import Indexes, { defaultIndexes } from '@plone/volto/constants/Indexes'; +import Pagination from '@plone/volto/components/theme/Pagination/Pagination'; +import Popup from '@plone/volto/components/theme/Popup/Popup'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; 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'; @@ -69,7 +67,7 @@ import ContentsWorkflowModal from '@plone/volto/components/manage/Contents/Conte 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 Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Contents/ContentsBreadcrumbs.jsx b/packages/volto/src/components/manage/Contents/ContentsBreadcrumbs.jsx index 417d8338d7..5d7d4c327b 100644 --- a/packages/volto/src/components/manage/Contents/ContentsBreadcrumbs.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsBreadcrumbs.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { Breadcrumb } from 'semantic-ui-react'; import { Link, useLocation } from 'react-router-dom'; import { defineMessages, useIntl } from 'react-intl'; -import { langmap } from '@plone/volto/helpers'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; import ContentsBreadcrumbsRootItem from '@plone/volto/components/manage/Contents/ContentsBreadcrumbsRootItem'; import ContentsBreadcrumbsHomeItem from '@plone/volto/components/manage/Contents/ContentsBreadcrumbsHomeItem'; diff --git a/packages/volto/src/components/manage/Contents/ContentsItem.jsx b/packages/volto/src/components/manage/Contents/ContentsItem.jsx index 20a0277f9c..1db0a4da4b 100644 --- a/packages/volto/src/components/manage/Contents/ContentsItem.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsItem.jsx @@ -7,10 +7,13 @@ import React from 'react'; import { Button, Table, Menu, Divider } from 'semantic-ui-react'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { useIntl, defineMessages, FormattedMessage } from 'react-intl'; -import { Circle, FormattedDate, Icon, Popup } from '@plone/volto/components'; -import { getContentIcon } from '@plone/volto/helpers'; +import Circle from '@plone/volto/components/manage/Contents/circle'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Popup from '@plone/volto/components/theme/Popup/Popup'; +import { getContentIcon } from '@plone/volto/helpers/Content/Content'; import moreSVG from '@plone/volto/icons/more.svg'; import checkboxUncheckedSVG from '@plone/volto/icons/checkbox-unchecked.svg'; import checkboxCheckedSVG from '@plone/volto/icons/checkbox-checked.svg'; diff --git a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx index 304e501e2f..acc36a6d57 100644 --- a/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsPropertiesModal.jsx @@ -1,12 +1,13 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; -import { isEmpty, map } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; +import map from 'lodash/map'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import { cloneDeepSchema } from '@plone/volto/helpers/Utils/Utils'; -import { updateContent } from '@plone/volto/actions'; +import { updateContent } from '@plone/volto/actions/content/content'; import { ModalForm } from '@plone/volto/components/manage/Form'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx b/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx index 0719e13263..c979552601 100644 --- a/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsRenameModal.jsx @@ -1,11 +1,13 @@ import React, { useCallback, useEffect } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; -import { concat, merge, map } from 'lodash'; +import concat from 'lodash/concat'; +import merge from 'lodash/merge'; +import map from 'lodash/map'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; -import { updateContent } from '@plone/volto/actions'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { updateContent } from '@plone/volto/actions/content/content'; import { ModalForm } from '@plone/volto/components/manage/Form'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx b/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx index bc594a8dac..9833c47999 100644 --- a/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsTagsModal.jsx @@ -1,11 +1,11 @@ import React, { useCallback, useEffect, useMemo } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; -import { updateContent } from '@plone/volto/actions'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { updateContent } from '@plone/volto/actions/content/content'; import { ModalForm } from '@plone/volto/components/manage/Form'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx b/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx index 0d83026e2d..5e1ab32007 100644 --- a/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsUploadModal.jsx @@ -14,13 +14,16 @@ import { Progress, } from 'semantic-ui-react'; import loadable from '@loadable/component'; -import { concat, filter, map } from 'lodash'; +import concat from 'lodash/concat'; +import filter from 'lodash/filter'; +import map from 'lodash/map'; import filesize from 'filesize'; import { readAsDataURL } from 'promise-file-reader'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; -import { FormattedRelativeDate } from '@plone/volto/components'; -import { createContent } from '@plone/volto/actions'; -import { validateFileUploadSize, usePrevious } from '@plone/volto/helpers'; +import FormattedRelativeDate from '@plone/volto/components/theme/FormattedDate/FormattedRelativeDate'; +import { createContent } from '@plone/volto/actions/content/content'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; const Dropzone = loadable(() => import('react-dropzone')); diff --git a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx index 2f2b6fafe7..57dd8b9d3e 100644 --- a/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx +++ b/packages/volto/src/components/manage/Contents/ContentsWorkflowModal.jsx @@ -1,11 +1,18 @@ import React, { useCallback, useEffect } from 'react'; import PropTypes from 'prop-types'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; -import { concat, filter, last, map, uniqBy } from 'lodash'; +import concat from 'lodash/concat'; +import filter from 'lodash/filter'; +import last from 'lodash/last'; +import map from 'lodash/map'; +import uniqBy from 'lodash/uniqBy'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; -import { getWorkflow, transitionWorkflow } from '@plone/volto/actions'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { + getWorkflow, + transitionWorkflow, +} from '@plone/volto/actions/workflow/workflow'; import { ModalForm } from '@plone/volto/components/manage/Form'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Controlpanels/AddonsControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/AddonsControlpanel.jsx index 761f0de1a8..92b53d773b 100644 --- a/packages/volto/src/components/manage/Controlpanels/AddonsControlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/AddonsControlpanel.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { Link } from 'react-router-dom'; import { createPortal } from 'react-dom'; -import { useClient } from '@plone/volto/hooks'; +import { useClient } from '@plone/volto/hooks/client/useClient'; import { Accordion, Button, @@ -22,9 +22,11 @@ import { listAddons, uninstallAddon, upgradeAddon, -} from '@plone/volto/actions'; -import { Helmet } from '@plone/volto/helpers'; -import { Icon, Toolbar, Toast } from '@plone/volto/components'; +} from '@plone/volto/actions/addons/addons'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import circleBottomSVG from '@plone/volto/icons/circle-bottom.svg'; import circleTopSVG from '@plone/volto/icons/circle-top.svg'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Aliases.jsx b/packages/volto/src/components/manage/Controlpanels/Aliases.jsx index 7b8375da93..ca231502f0 100644 --- a/packages/volto/src/components/manage/Controlpanels/Aliases.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Aliases.jsx @@ -1,7 +1,8 @@ import { useState, useEffect, useCallback, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Link, useHistory, useLocation } from 'react-router-dom'; -import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers'; +import { getBaseUrl, getParentUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { removeAliases, addAliases, @@ -27,15 +28,16 @@ import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import DatetimeWidget from '@plone/volto/components/manage/Widgets/DatetimeWidget'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; import { ModalForm } from '@plone/volto/components/manage/Form'; -import { Icon, Toolbar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; -import { useClient } from '@plone/volto/hooks'; +import { useClient } from '@plone/volto/hooks/client/useClient'; import backSVG from '@plone/volto/icons/back.svg'; import editingSVG from '@plone/volto/icons/editing.svg'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; const messages = defineMessages({ back: { diff --git a/packages/volto/src/components/manage/Controlpanels/ContentType.jsx b/packages/volto/src/components/manage/Controlpanels/ContentType.jsx index 531389e5f1..55cdc77311 100644 --- a/packages/volto/src/components/manage/Controlpanels/ContentType.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ContentType.jsx @@ -7,15 +7,23 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { getParentUrl } from '@plone/volto/helpers'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; import { createPortal } from 'react-dom'; 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, Icon, Toolbar, Toast } from '@plone/volto/components'; +import last from 'lodash/last'; +import nth from 'lodash/nth'; +import join from 'lodash/join'; +import Error from '@plone/volto/components/theme/Error/Error'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; -import { getControlpanel, updateControlpanel } from '@plone/volto/actions'; +import { + getControlpanel, + updateControlpanel, +} from '@plone/volto/actions/controlpanels/controlpanels'; import saveSVG from '@plone/volto/icons/save.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx index 7135562957..03777e5b01 100644 --- a/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ContentTypeLayout.jsx @@ -8,25 +8,29 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; import { - getParentUrl, hasBlocksData, getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; import { createPortal } from 'react-dom'; 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, Icon, Toolbar, Sidebar, Toast } from '@plone/volto/components'; +import nth from 'lodash/nth'; +import join from 'lodash/join'; +import Error from '@plone/volto/components/theme/Error/Error'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Sidebar from '@plone/volto/components/manage/Sidebar/Sidebar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; +import { getSchema, updateSchema } from '@plone/volto/actions/schema/schema'; import { - getSchema, - updateSchema, getControlpanel, updateControlpanel, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/controlpanels/controlpanels'; import saveSVG from '@plone/volto/icons/save.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx index 1215aaeb61..81cf96a5a2 100644 --- a/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ContentTypeSchema.jsx @@ -3,10 +3,13 @@ * @module components/manage/Controlpanels/ContentTypeSchema */ -import { getSchema, putSchema } from '@plone/volto/actions'; -import { getParentUrl } from '@plone/volto/helpers'; -import { nth } from 'lodash'; -import { Error, Icon, Toast, Toolbar } from '@plone/volto/components'; +import { getSchema, putSchema } from '@plone/volto/actions/schema/schema'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; +import nth from 'lodash/nth'; +import Error from '@plone/volto/components/theme/Error/Error'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; import { Form } from '@plone/volto/components/manage/Form'; import clearSVG from '@plone/volto/icons/clear.svg'; import saveSVG from '@plone/volto/icons/save.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx index 45a8846ac1..5981792f0d 100644 --- a/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ContentTypes.jsx @@ -8,20 +8,22 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getParentUrl } from '@plone/volto/helpers'; +import { getParentUrl, getId } from '@plone/volto/helpers/Url/Url'; import { createPortal } from 'react-dom'; -import { last } from 'lodash'; +import last from 'lodash/last'; 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, Toolbar, Toast } from '@plone/volto/components'; +import Error from '@plone/volto/components/theme/Error/Error'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import ContentTypesActions from '@plone/volto/components/manage/Controlpanels/ContentTypesActions'; import { getControlpanel, postControlpanel, deleteControlpanel, -} from '@plone/volto/actions'; -import { getId } from '@plone/volto/helpers'; +} from '@plone/volto/actions/controlpanels/controlpanels'; import addSVG from '@plone/volto/icons/add-document.svg'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/ContentTypesActions.jsx b/packages/volto/src/components/manage/Controlpanels/ContentTypesActions.jsx index 7d6bdb400a..470b018c5e 100644 --- a/packages/volto/src/components/manage/Controlpanels/ContentTypesActions.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ContentTypesActions.jsx @@ -6,7 +6,7 @@ import React from 'react'; import { Dropdown } from 'semantic-ui-react'; import { FormattedMessage, injectIntl } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import trashSVG from '@plone/volto/icons/delete.svg'; import layoutSVG from '@plone/volto/icons/file.svg'; import folderSVG from '@plone/volto/icons/folder.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx index 9970c962b5..0aa770d7e1 100644 --- a/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Controlpanel.jsx @@ -8,19 +8,24 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { withRouter } from 'react-router-dom'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { - Helmet, tryParseJSON, extractInvariantErrors, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/FormValidation/FormValidation'; import { createPortal } from 'react-dom'; import { Button, Container } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; import { toast } from 'react-toastify'; -import { Icon, Toolbar, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; -import { updateControlpanel, getControlpanel } from '@plone/volto/actions'; +import { + updateControlpanel, + getControlpanel, +} from '@plone/volto/actions/controlpanels/controlpanels'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx b/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx index e5622d8d25..0602f11d8d 100644 --- a/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Controlpanels.jsx @@ -3,8 +3,13 @@ * @module components/manage/Controlpanels/Controlpanels */ -import { Helmet } from '@plone/volto/helpers'; -import { concat, filter, last, map, sortBy, uniqBy } from 'lodash'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import concat from 'lodash/concat'; +import filter from 'lodash/filter'; +import last from 'lodash/last'; +import map from 'lodash/map'; +import sortBy from 'lodash/sortBy'; +import uniqBy from 'lodash/uniqBy'; import { useEffect, useState } from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { createPortal } from 'react-dom'; @@ -12,7 +17,10 @@ import { useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; import { Container, Grid, Header, Message, Segment } from 'semantic-ui-react'; -import { Error, Icon, Toolbar, VersionOverview } from '@plone/volto/components'; +import Error from '@plone/volto/components/theme/Error/Error'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import VersionOverview from '@plone/volto/components/manage/Controlpanels/VersionOverview'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Controlpanels/DatabaseInformation.jsx b/packages/volto/src/components/manage/Controlpanels/DatabaseInformation.jsx index c79f9fb0a4..790f197949 100644 --- a/packages/volto/src/components/manage/Controlpanels/DatabaseInformation.jsx +++ b/packages/volto/src/components/manage/Controlpanels/DatabaseInformation.jsx @@ -5,10 +5,11 @@ import { createPortal } from 'react-dom'; import { Container, Divider, Message, Segment, Table } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; -import { getDatabaseInformation } from '@plone/volto/actions'; -import { Helmet } from '@plone/volto/helpers'; -import { useClient } from '@plone/volto/hooks'; -import { Icon, Toolbar } from '@plone/volto/components'; +import { getDatabaseInformation } from '@plone/volto/actions/controlpanels/controlpanels'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { useClient } from '@plone/volto/hooks/client/useClient'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; import backSVG from '@plone/volto/icons/back.svg'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx index 831d0fb529..ac74bf6209 100644 --- a/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx @@ -6,34 +6,31 @@ import { createGroup, deleteGroup, listGroups, - getControlpanel, - listRoles, updateGroup, - authenticatedRole, - getUser, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/groups/groups'; +import { listRoles } from '@plone/volto/actions/roles/roles'; +import { getControlpanel } from '@plone/volto/actions/controlpanels/controlpanels'; +import { authenticatedRole } from '@plone/volto/actions/authRole/authRole'; +import { getUser } from '@plone/volto/actions/users/users'; import jwtDecode from 'jwt-decode'; -import { - Icon, - Toast, - Toolbar, - Pagination, - Error, -} from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Pagination from '@plone/volto/components/theme/Pagination/Pagination'; +import Error from '@plone/volto/components/theme/Error/Error'; 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, - messages, - isManager, - canAssignRole, -} from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { isManager, canAssignRole } from '@plone/volto/helpers/User/User'; import clearSVG from '@plone/volto/icons/clear.svg'; import addUserSvg from '@plone/volto/icons/add-user.svg'; import saveSVG from '@plone/volto/icons/save.svg'; import ploneSVG from '@plone/volto/icons/plone.svg'; -import { find, map, pull } from 'lodash'; +import find from 'lodash/find'; +import map from 'lodash/map'; +import pull from 'lodash/pull'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { FormattedMessage, injectIntl } from 'react-intl'; diff --git a/packages/volto/src/components/manage/Controlpanels/Groups/RenderGroups.jsx b/packages/volto/src/components/manage/Controlpanels/Groups/RenderGroups.jsx index c1117a59bd..7fab05b179 100644 --- a/packages/volto/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Groups/RenderGroups.jsx @@ -3,8 +3,8 @@ import { FormattedMessage } from 'react-intl'; import { Dropdown, Table, Checkbox } from 'semantic-ui-react'; import trashSVG from '@plone/volto/icons/delete.svg'; import ploneSVG from '@plone/volto/icons/plone.svg'; -import { Icon } from '@plone/volto/components'; -import { canAssignRole } from '@plone/volto/helpers'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { canAssignRole } from '@plone/volto/helpers/User/User'; const RenderGroups = (props) => { const onChange = (event, { value }) => { diff --git a/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx b/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx index b2e35eb089..7825a70c47 100644 --- a/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx +++ b/packages/volto/src/components/manage/Controlpanels/ModerateComments.jsx @@ -8,13 +8,17 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getParentUrl, Helmet } from '@plone/volto/helpers'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { createPortal } from 'react-dom'; import { Container, Button, Table } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { deleteComment, searchContent } from '@plone/volto/actions'; -import { FormattedRelativeDate, Icon, Toolbar } from '@plone/volto/components'; +import { deleteComment } from '@plone/volto/actions/comments/comments'; +import { searchContent } from '@plone/volto/actions/search/search'; +import FormattedRelativeDate from '@plone/volto/components/theme/FormattedDate/FormattedRelativeDate'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; 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/Relations/BrokenRelations.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx index ae9c8ba77b..869df519fe 100644 --- a/packages/volto/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Relations/BrokenRelations.jsx @@ -1,11 +1,11 @@ import React, { useEffect } from 'react'; -import { uniqBy } from 'lodash'; +import uniqBy from 'lodash/uniqBy'; import { FormattedMessage } from 'react-intl'; import { useSelector, useDispatch } from 'react-redux'; import { Divider, Segment, Table } from 'semantic-ui-react'; -import { queryRelations } from '@plone/volto/actions'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { ConditionalLink } from '@plone/volto/components'; +import { queryRelations } from '@plone/volto/actions/relations/relations'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; const BrokenRelations = () => { const dispatch = useDispatch(); diff --git a/packages/volto/src/components/manage/Controlpanels/Relations/Relations.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/Relations.jsx index 73c56efa41..3fc0494eeb 100644 --- a/packages/volto/src/components/manage/Controlpanels/Relations/Relations.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Relations/Relations.jsx @@ -2,7 +2,7 @@ * Relations Control Panel */ import React, { useEffect, useState } from 'react'; -import { find } from 'lodash'; +import find from 'lodash/find'; import { useSelector } from 'react-redux'; import { createPortal } from 'react-dom'; import { useHistory } from 'react-router'; @@ -10,10 +10,12 @@ import { Link, useLocation } from 'react-router-dom'; import { FormattedMessage, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { Divider, Message, Segment } from 'semantic-ui-react'; -import { Helmet, messages } from '@plone/volto/helpers'; -import { listActions } from '@plone/volto/actions'; -import { Icon, Toolbar } from '@plone/volto/components'; -import { getParentUrl } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; import RelationsMatrix from '@plone/volto/components/manage/Controlpanels/Relations/RelationsMatrix'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx index a46fc3cdbc..347d4f1ff3 100644 --- a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsListing.jsx @@ -3,17 +3,20 @@ import useDeepCompareEffect from 'use-deep-compare-effect'; import { FormattedMessage, useIntl } from 'react-intl'; import { useSelector, useDispatch } from 'react-redux'; import { toast } from 'react-toastify'; -import { uniqBy } from 'lodash'; +import uniqBy from 'lodash/uniqBy'; import { Checkbox, Message } from 'semantic-ui-react'; -import { messages } from '@plone/volto/helpers'; -import { Toast, UniversalLink } from '@plone/volto/components'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { createRelations, deleteRelations, queryRelations, +} from '@plone/volto/actions/relations/relations'; +import { resetSearchContent, searchContent, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/search/search'; const RelationsListing = ({ relationtype, diff --git a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx index 3bc8003b15..652e6fbee2 100644 --- a/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Relations/RelationsMatrix.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { capitalize, find } from 'lodash'; +import capitalize from 'lodash/capitalize'; +import find from 'lodash/find'; import { compose } from 'redux'; import { useSelector, useDispatch } from 'react-redux'; import { FormattedMessage, useIntl } from 'react-intl'; @@ -15,13 +16,14 @@ import { Tab, } from 'semantic-ui-react'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; -import { messages } from '@plone/volto/helpers'; -import { Icon, Toast } from '@plone/volto/components'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { getRelationStats, queryRelations, - rebuildRelations, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/relations/relations'; +import { rebuildRelations } from '@plone/volto/actions/relations/rebuild'; 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'; diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx index 8a6fe6818e..6cb110c747 100644 --- a/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Rules/AddRule.jsx @@ -8,7 +8,8 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers'; +import { getBaseUrl, getParentUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { createPortal } from 'react-dom'; import { Button, @@ -19,11 +20,16 @@ import { Segment, } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { Icon, Toolbar, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Field } from '@plone/volto/components/manage/Form'; import { toast } from 'react-toastify'; -import { getContentRulesEvents, addNewRule } from '@plone/volto/actions'; +import { + getContentRulesEvents, + addNewRule, +} from '@plone/volto/actions/rules/rules'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx index 65887da7f3..c67db3839e 100644 --- a/packages/volto/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx @@ -8,7 +8,8 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers'; +import { getBaseUrl, getParentUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { createPortal } from 'react-dom'; import { Button, @@ -19,7 +20,9 @@ import { Segment, } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { Icon, Toolbar, UniversalLink } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { getControlPanelRule, removeCondition, @@ -32,9 +35,9 @@ import { getAction, moveRuleCondition, moveRuleAction, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/rules/rules'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import backSVG from '@plone/volto/icons/back.svg'; import upSVG from '@plone/volto/icons/up.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx index 0021ae6f78..b3c62ba901 100644 --- a/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Rules/EditRule.jsx @@ -8,7 +8,8 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getParentUrl, Helmet, getBaseUrl } from '@plone/volto/helpers'; +import { getParentUrl, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { createPortal } from 'react-dom'; import { Button, @@ -20,13 +21,15 @@ import { } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { Icon, Toolbar, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Field } from '@plone/volto/components/manage/Form'; import { getControlPanelRule, editRule, getContentRulesEvents, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/rules/rules'; import { toast } from 'react-toastify'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Rules/Rules.jsx b/packages/volto/src/components/manage/Controlpanels/Rules/Rules.jsx index 0f3545d919..e2bfcfd1ac 100644 --- a/packages/volto/src/components/manage/Controlpanels/Rules/Rules.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Rules/Rules.jsx @@ -8,7 +8,8 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { getBaseUrl, getParentUrl, Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { getBaseUrl, getParentUrl } from '@plone/volto/helpers/Url/Url'; import { createPortal } from 'react-dom'; import { Button, @@ -20,16 +21,17 @@ import { Table, } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { Icon, Toolbar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { getControlPanelRules, deleteControlPanelRule, getContentRulesEvents, editRule, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/rules/rules'; import backSVG from '@plone/volto/icons/back.svg'; 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 20c31454f8..f38dbc9b2e 100644 --- a/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Rules/components/VariableModal.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { Modal } from 'semantic-ui-react'; import { connect } from 'react-redux'; -import { getVocabulary } from '@plone/volto/actions'; +import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies'; import { injectIntl } from 'react-intl'; import { compose } from 'redux'; diff --git a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx index fc38b92ad5..074b448c4c 100644 --- a/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/UndoControlpanel.jsx @@ -10,15 +10,20 @@ 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, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; 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'; +import map from 'lodash/map'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import nextIcon from '@plone/volto/icons/right-key.svg'; import prevIcon from '@plone/volto/icons/left-key.svg'; import undoSVG from '@plone/volto/icons/undo.svg'; -import { getTransactions, revertTransactions } from '@plone/volto/actions'; +import { + getTransactions, + revertTransactions, +} from '@plone/volto/actions/transactions/transactions'; import { toast } from 'react-toastify'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx b/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx index a4d6514319..5ddf40630c 100644 --- a/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/UpgradeControlPanel.jsx @@ -17,15 +17,17 @@ import { Table, } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { map } from 'lodash'; +import map from 'lodash/map'; +import { getSystemInformation } from '@plone/volto/actions/controlpanels/controlpanels'; import { - getSystemInformation, getUpgradeInformation, runUpgrade, -} from '@plone/volto/actions'; -import { Helmet } from '@plone/volto/helpers'; -import { Icon, Toast, Toolbar } from '@plone/volto/components'; +} from '@plone/volto/actions/upgrade/upgrade'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; 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 9b9ca1ca63..99dccbfb76 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/RenderUsers.jsx @@ -8,13 +8,15 @@ 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, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { ModalForm } from '@plone/volto/components/manage/Form'; -import { updateUser } from '@plone/volto/actions'; +import { updateUser } from '@plone/volto/actions/users/users'; import ploneSVG from '@plone/volto/icons/plone.svg'; import { compose } from 'redux'; import { connect } from 'react-redux'; -import { messages, canAssignRole } from '@plone/volto/helpers'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { canAssignRole } from '@plone/volto/helpers/User/User'; import { toast } from 'react-toastify'; /** diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx index 0acb553959..5951f0a849 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx @@ -3,21 +3,24 @@ * TODO Enrich with features of user control panel. Then replace user control panel. */ import React, { useEffect, useState } from 'react'; -import { find } from 'lodash'; +import find from 'lodash/find'; import { createPortal } from 'react-dom'; import { useHistory } from 'react-router'; import { Link, useLocation } from 'react-router-dom'; import { FormattedMessage, useIntl } from 'react-intl'; import { useDispatch, useSelector } from 'react-redux'; import { Segment } from 'semantic-ui-react'; -import { Helmet, messages } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; import { getControlpanel, getSystemInformation, - listActions, -} from '@plone/volto/actions'; -import { Icon, Toolbar, Unauthorized } from '@plone/volto/components'; -import { getParentUrl } from '@plone/volto/helpers'; +} from '@plone/volto/actions/controlpanels/controlpanels'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; +import { getParentUrl } from '@plone/volto/helpers/Url/Url'; import UserGroupMembershipMatrix from '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipMatrix'; import backSVG from '@plone/volto/icons/back.svg'; import settingsSVG from '@plone/volto/icons/settings.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx index 4530107479..489456026d 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx @@ -1,14 +1,18 @@ import React, { useEffect, useState, useMemo } from 'react'; -import { cloneDeep, uniqBy, debounce } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; +import uniqBy from 'lodash/uniqBy'; +import debounce from 'lodash/debounce'; import { useIntl } from 'react-intl'; import { useSelector, useDispatch, shallowEqual } from 'react-redux'; import jwtDecode from 'jwt-decode'; import { toast } from 'react-toastify'; import { Button, Checkbox } from 'semantic-ui-react'; -import { messages, isManager, canAssignGroup } from '@plone/volto/helpers'; -import { listGroups, getUser } from '@plone/volto/actions'; -import { Icon, Toast } from '@plone/volto/components'; -import { updateGroup, listUsers } from '@plone/volto/actions'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { isManager, canAssignGroup } from '@plone/volto/helpers/User/User'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import { listGroups, updateGroup } from '@plone/volto/actions/groups/groups'; +import { getUser, listUsers } from '@plone/volto/actions/users/users'; import down_key from '@plone/volto/icons/down-key.svg'; diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx index 9fa184ce80..6a0eb4b3e2 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx @@ -3,10 +3,11 @@ import { useSelector, useDispatch } from 'react-redux'; import { useIntl } from 'react-intl'; import { Checkbox, Form, Input } from 'semantic-ui-react'; -import { isEqual, debounce } from 'lodash'; +import isEqual from 'lodash/isEqual'; +import debounce from 'lodash/debounce'; -import { messages } from '@plone/volto/helpers'; -import { listGroups } from '@plone/volto/actions'; // getRegistry +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { listGroups } from '@plone/volto/actions/groups/groups'; // getRegistry import UserGroupMembershipListing from '@plone/volto/components/manage/Controlpanels/Users/UserGroupMembershipListing'; const UserGroupMembershipMatrix = ({ many_users, many_groups }) => { diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx index a24b1fda32..59a6a0d650 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx @@ -5,37 +5,34 @@ import { createUser, deleteUser, - listRoles, - listGroups, listUsers, - getControlpanel, updateUser, - updateGroup, - getUserSchema, getUser, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/users/users'; +import { listRoles } from '@plone/volto/actions/roles/roles'; +import { listGroups, updateGroup } from '@plone/volto/actions/groups/groups'; +import { getControlpanel } from '@plone/volto/actions/controlpanels/controlpanels'; +import { getUserSchema } from '@plone/volto/actions/userschema/userschema'; import jwtDecode from 'jwt-decode'; -import { - Icon, - Toast, - Toolbar, - Pagination, - Error, -} from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Pagination from '@plone/volto/components/theme/Pagination/Pagination'; +import Error from '@plone/volto/components/theme/Error/Error'; 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, - messages, - isManager, - canAssignGroup, -} from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import { isManager, canAssignGroup } from '@plone/volto/helpers/User/User'; import clearSVG from '@plone/volto/icons/clear.svg'; import addUserSvg from '@plone/volto/icons/add-user.svg'; import saveSVG from '@plone/volto/icons/save.svg'; import ploneSVG from '@plone/volto/icons/plone.svg'; -import { find, map, pull, difference } from 'lodash'; +import find from 'lodash/find'; +import map from 'lodash/map'; +import pull from 'lodash/pull'; +import difference from 'lodash/difference'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { FormattedMessage, injectIntl } from 'react-intl'; diff --git a/packages/volto/src/components/manage/Controlpanels/VersionOverview.jsx b/packages/volto/src/components/manage/Controlpanels/VersionOverview.jsx index 458350f461..1bb5648a35 100644 --- a/packages/volto/src/components/manage/Controlpanels/VersionOverview.jsx +++ b/packages/volto/src/components/manage/Controlpanels/VersionOverview.jsx @@ -5,7 +5,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import voltoPackageJson from '../../../../package.json'; import projectPackageJson from '@root/../package.json'; diff --git a/packages/volto/src/components/manage/Controlpanels/index.tsx b/packages/volto/src/components/manage/Controlpanels/index.tsx index e545fe0722..a552a2e887 100644 --- a/packages/volto/src/components/manage/Controlpanels/index.tsx +++ b/packages/volto/src/components/manage/Controlpanels/index.tsx @@ -1,6 +1,9 @@ import loadable from '@loadable/component'; -import { getSystemInformation, listControlpanels } from '@plone/volto/actions'; -import { asyncConnect } from '@plone/volto/helpers'; +import { + getSystemInformation, + listControlpanels, +} from '@plone/volto/actions/controlpanels/controlpanels'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; // CONTROLPANELS diff --git a/packages/volto/src/components/manage/Delete/Delete.jsx b/packages/volto/src/components/manage/Delete/Delete.jsx index 50da8f9b2e..5aa37f60e3 100644 --- a/packages/volto/src/components/manage/Delete/Delete.jsx +++ b/packages/volto/src/components/manage/Delete/Delete.jsx @@ -6,9 +6,13 @@ import { Button, Container, List, Segment } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import qs from 'query-string'; -import { Toolbar } from '@plone/volto/components'; -import { Helmet, usePrevious } from '@plone/volto/helpers'; -import { deleteContent, getContent } from '@plone/volto/actions'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { + deleteContent, + getContent, +} from '@plone/volto/actions/content/content'; const messages = defineMessages({ delete: { diff --git a/packages/volto/src/components/manage/Diff/Diff.jsx b/packages/volto/src/components/manage/Diff/Diff.jsx index 01ea0002ab..4655301c4e 100644 --- a/packages/volto/src/components/manage/Diff/Diff.jsx +++ b/packages/volto/src/components/manage/Diff/Diff.jsx @@ -5,29 +5,31 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { filter, isEqual, map } from 'lodash'; +import filter from 'lodash/filter'; +import isEqual from 'lodash/isEqual'; +import map from 'lodash/map'; import { Container, Button, Dropdown, Grid, Table } from 'semantic-ui-react'; import { Link, withRouter } from 'react-router-dom'; import { createPortal } from 'react-dom'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import qs from 'query-string'; -import { getDiff, getSchema, getHistory } from '@plone/volto/actions'; +import { getDiff } from '@plone/volto/actions/diff/diff'; +import { getSchema } from '@plone/volto/actions/schema/schema'; +import { getHistory } from '@plone/volto/actions/history/history'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import { - getBaseUrl, getBlocksFieldname, getBlocksLayoutFieldname, hasBlocksData, -} from '@plone/volto/helpers'; -import { - FormattedDate, - Icon, - Toolbar, - Unauthorized, -} from '@plone/volto/components'; +} from '@plone/volto/helpers/Blocks/Blocks'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; 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/Diff/DiffField.jsx b/packages/volto/src/components/manage/Diff/DiffField.jsx index a9bad2afb2..a389361e94 100644 --- a/packages/volto/src/components/manage/Diff/DiffField.jsx +++ b/packages/volto/src/components/manage/Diff/DiffField.jsx @@ -4,7 +4,8 @@ */ import React from 'react'; -import { join, map } from 'lodash'; +import join from 'lodash/join'; +import map from 'lodash/map'; import PropTypes from 'prop-types'; import { Grid } from 'semantic-ui-react'; import ReactDOMServer from 'react-dom/server'; @@ -13,9 +14,9 @@ import { createBrowserHistory } from 'history'; import { ConnectedRouter } from 'connected-react-router'; import { useSelector } from 'react-redux'; import config from '@plone/volto/registry'; -import { Api } from '@plone/volto/helpers'; +import Api from '@plone/volto/helpers/Api/Api'; import configureStore from '@plone/volto/store'; -import { RenderBlocks } from '@plone/volto/components'; +import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; import { serializeNodes } from '@plone/volto-slate/editor/render'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; diff --git a/packages/volto/src/components/manage/Display/Display.jsx b/packages/volto/src/components/manage/Display/Display.jsx index 7633b804a1..b6d4f3cec1 100644 --- a/packages/volto/src/components/manage/Display/Display.jsx +++ b/packages/volto/src/components/manage/Display/Display.jsx @@ -4,10 +4,15 @@ import { useDispatch, useSelector } from 'react-redux'; import { compose } from 'redux'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; -import { getSchema, updateContent, getContent } from '@plone/volto/actions'; -import { getLayoutFieldname } from '@plone/volto/helpers'; -import { usePrevious } from '@plone/volto/helpers'; -import { FormFieldWrapper, Icon } from '@plone/volto/components'; +import { getSchema } from '@plone/volto/actions/schema/schema'; +import { + updateContent, + getContent, +} from '@plone/volto/actions/content/content'; +import { getLayoutFieldname } from '@plone/volto/helpers/Content/Content'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { defineMessages, useIntl } from 'react-intl'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/DragDropList/DragDropList.jsx b/packages/volto/src/components/manage/DragDropList/DragDropList.jsx index d330239df4..72b9ad99c1 100644 --- a/packages/volto/src/components/manage/DragDropList/DragDropList.jsx +++ b/packages/volto/src/components/manage/DragDropList/DragDropList.jsx @@ -1,5 +1,5 @@ import React, { useRef } from 'react'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { v4 as uuid } from 'uuid'; diff --git a/packages/volto/src/components/manage/Edit/Edit.jsx b/packages/volto/src/components/manage/Edit/Edit.jsx index 93efab9a7c..af91517138 100644 --- a/packages/volto/src/components/manage/Edit/Edit.jsx +++ b/packages/volto/src/components/manage/Edit/Edit.jsx @@ -5,44 +5,41 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Helmet, extractInvariantErrors } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { extractInvariantErrors } from '@plone/volto/helpers/FormValidation/FormValidation'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { asyncConnect, hasApiExpander } from '@plone/volto/helpers'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import { defineMessages, injectIntl } from 'react-intl'; import { Button, Grid, Menu } from 'semantic-ui-react'; import { createPortal } from 'react-dom'; import qs from 'query-string'; -import { find } from 'lodash'; +import find from 'lodash/find'; import { toast } from 'react-toastify'; -import { - Forbidden, - Icon, - Sidebar, - Toast, - Toolbar, - Unauthorized, - CompareLanguages, - TranslationObject, -} from '@plone/volto/components'; +import Forbidden from '@plone/volto/components/theme/Forbidden/Forbidden'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Sidebar from '@plone/volto/components/manage/Sidebar/Sidebar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; +import CompareLanguages from '@plone/volto/components/manage/Multilingual/CompareLanguages'; +import TranslationObject from '@plone/volto/components/manage/Multilingual/TranslationObject'; import { Form } from '@plone/volto/components/manage/Form'; import { updateContent, getContent, lockContent, unlockContent, - getSchema, - listActions, - setFormData, -} from '@plone/volto/actions'; -import { - flattenToAppURL, - getBaseUrl, - hasBlocksData, -} from '@plone/volto/helpers'; +} from '@plone/volto/actions/content/content'; +import { getSchema } from '@plone/volto/actions/schema/schema'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import { setFormData } from '@plone/volto/actions/form/form'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks'; import { preloadLazyLibs } from '@plone/volto/helpers/Loadable'; -import { tryParseJSON } from '@plone/volto/helpers'; +import { tryParseJSON } from '@plone/volto/helpers/FormValidation/FormValidation'; import saveSVG from '@plone/volto/icons/save.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Form/BlockDataForm.jsx b/packages/volto/src/components/manage/Form/BlockDataForm.jsx index 4814f021e7..ae28e9eb87 100644 --- a/packages/volto/src/components/manage/Form/BlockDataForm.jsx +++ b/packages/volto/src/components/manage/Form/BlockDataForm.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { InlineForm } from '@plone/volto/components/manage/Form'; -import { withVariationSchemaEnhancer } from '@plone/volto/helpers'; +import { withVariationSchemaEnhancer } from '@plone/volto/helpers/Extensions'; const EnhancedBlockDataForm = withVariationSchemaEnhancer(InlineForm); diff --git a/packages/volto/src/components/manage/Form/BlocksToolbar.jsx b/packages/volto/src/components/manage/Form/BlocksToolbar.jsx index 7e1fa15729..ca7d713a00 100644 --- a/packages/volto/src/components/manage/Form/BlocksToolbar.jsx +++ b/packages/volto/src/components/manage/Form/BlocksToolbar.jsx @@ -2,18 +2,23 @@ import React from 'react'; import { compose } from 'redux'; import { connect } from 'react-redux'; import { injectIntl } from 'react-intl'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; import { - messages, getBlocksFieldname, getBlocksLayoutFieldname, -} from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; +} from '@plone/volto/helpers/Blocks/Blocks'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Plug } from '@plone/volto/components/manage/Pluggable'; import { v4 as uuid } from 'uuid'; import { load } from 'redux-localstorage-simple'; -import { isEqual, omit, without } from 'lodash'; +import isEqual from 'lodash/isEqual'; +import omit from 'lodash/omit'; +import without from 'lodash/without'; -import { setBlocksClipboard, resetBlocksClipboard } from '@plone/volto/actions'; +import { + setBlocksClipboard, + resetBlocksClipboard, +} from '@plone/volto/actions/blocksClipboard/blocksClipboard'; import config from '@plone/volto/registry'; import copySVG from '@plone/volto/icons/copy.svg'; diff --git a/packages/volto/src/components/manage/Form/Form.jsx b/packages/volto/src/components/manage/Form/Form.jsx index 41a4c3f97c..d19b68a603 100644 --- a/packages/volto/src/components/manage/Form/Form.jsx +++ b/packages/volto/src/components/manage/Form/Form.jsx @@ -3,34 +3,33 @@ * @module components/manage/Form/Form */ -import { Icon, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Field, BlocksForm } from '@plone/volto/components/manage/Form'; import BlocksToolbar from '@plone/volto/components/manage/Form/BlocksToolbar'; import UndoToolbar from '@plone/volto/components/manage/Form/UndoToolbar'; +import { difference } from '@plone/volto/helpers/Utils/Utils'; +import FormValidation from '@plone/volto/helpers/FormValidation/FormValidation'; import { - difference, - FormValidation, getBlocksFieldname, getBlocksLayoutFieldname, hasBlocksData, - messages, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; import aheadSVG from '@plone/volto/icons/ahead.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; import upSVG from '@plone/volto/icons/up-key.svg'; import downSVG from '@plone/volto/icons/down-key.svg'; -import { - findIndex, - isEmpty, - isEqual, - keys, - map, - mapValues, - pickBy, - without, - cloneDeep, - xor, -} from 'lodash'; +import findIndex from 'lodash/findIndex'; +import isEmpty from 'lodash/isEmpty'; +import isEqual from 'lodash/isEqual'; +import keys from 'lodash/keys'; +import map from 'lodash/map'; +import mapValues from 'lodash/mapValues'; +import pickBy from 'lodash/pickBy'; +import without from 'lodash/without'; +import cloneDeep from 'lodash/cloneDeep'; +import xor from 'lodash/xor'; import isBoolean from 'lodash/isBoolean'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; @@ -52,9 +51,8 @@ import { setMetadataFieldsets, resetMetadataFocus, setSidebarTab, - setFormData, - setUIState, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/sidebar/sidebar'; +import { setFormData, setUIState } from '@plone/volto/actions/form/form'; import { compose } from 'redux'; import config from '@plone/volto/registry'; import SlotRenderer from '@plone/volto/components/theme/SlotRenderer/SlotRenderer'; diff --git a/packages/volto/src/components/manage/Form/InlineForm.jsx b/packages/volto/src/components/manage/Form/InlineForm.jsx index f3998f434e..a92f6aaba2 100644 --- a/packages/volto/src/components/manage/Form/InlineForm.jsx +++ b/packages/volto/src/components/manage/Form/InlineForm.jsx @@ -3,7 +3,9 @@ import PropTypes from 'prop-types'; import { Accordion, Segment, Message } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; import AnimateHeight from 'react-animate-height'; -import { keys, map, isEqual } from 'lodash'; +import keys from 'lodash/keys'; +import map from 'lodash/map'; +import isEqual from 'lodash/isEqual'; import { useAtom } from 'jotai'; import { inlineFormFieldsetsState } from './InlineFormState'; import { @@ -11,9 +13,9 @@ import { removeFromArray, arrayRange, } from '@plone/volto/helpers/Utils/Utils'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Field } from '@plone/volto/components/manage/Form'; -import { applySchemaDefaults } from '@plone/volto/helpers'; +import { applySchemaDefaults } from '@plone/volto/helpers/Blocks/Blocks'; import upSVG from '@plone/volto/icons/up-key.svg'; import downSVG from '@plone/volto/icons/down-key.svg'; diff --git a/packages/volto/src/components/manage/Form/InlineFormState.js b/packages/volto/src/components/manage/Form/InlineFormState.js index 2c41c4f99b..d37a47594f 100644 --- a/packages/volto/src/components/manage/Form/InlineFormState.js +++ b/packages/volto/src/components/manage/Form/InlineFormState.js @@ -1,6 +1,6 @@ import { atom } from 'jotai'; import { atomFamily } from 'jotai/utils'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; export const inlineFormFieldsetsState = atomFamily( ({ name, initialState }) => atom(initialState), diff --git a/packages/volto/src/components/manage/Form/ModalForm.jsx b/packages/volto/src/components/manage/Form/ModalForm.jsx index 4bc39652c1..6a01305608 100644 --- a/packages/volto/src/components/manage/Form/ModalForm.jsx +++ b/packages/volto/src/components/manage/Form/ModalForm.jsx @@ -5,7 +5,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { keys, map } from 'lodash'; +import keys from 'lodash/keys'; +import map from 'lodash/map'; import { Button, Form as UiForm, @@ -17,8 +18,8 @@ import { Loader, } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { FormValidation } from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; +import FormValidation from '@plone/volto/helpers/FormValidation/FormValidation'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; 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/UndoToolbar.jsx b/packages/volto/src/components/manage/Form/UndoToolbar.jsx index 2290354222..92b3d69bab 100644 --- a/packages/volto/src/components/manage/Form/UndoToolbar.jsx +++ b/packages/volto/src/components/manage/Form/UndoToolbar.jsx @@ -1,9 +1,9 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Plug } from '@plone/volto/components/manage/Pluggable'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; -import { useUndoManager } from '@plone/volto/helpers'; +import useUndoManager from '@plone/volto/helpers/UndoManager/useUndoManager'; import config from '@plone/volto/registry'; import undoSVG from '@plone/volto/icons/undo.svg'; diff --git a/packages/volto/src/components/manage/History/History.jsx b/packages/volto/src/components/manage/History/History.jsx index 5b45124ffb..bf86bb698f 100644 --- a/packages/volto/src/components/manage/History/History.jsx +++ b/packages/volto/src/components/manage/History/History.jsx @@ -5,7 +5,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import { compose } from 'redux'; @@ -16,20 +16,25 @@ import { Segment, Table, } from 'semantic-ui-react'; -import { concat, map, reverse, find } from 'lodash'; +import concat from 'lodash/concat'; +import map from 'lodash/map'; +import reverse from 'lodash/reverse'; +import find from 'lodash/find'; import { createPortal } from 'react-dom'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { asyncConnect } from '@plone/volto/helpers'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; +import IconNext from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Forbidden from '@plone/volto/components/theme/Forbidden/Forbidden'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; import { - FormattedDate, - Icon as IconNext, - Toolbar, - Forbidden, - Unauthorized, -} from '@plone/volto/components'; -import { getHistory, revertHistory, listActions } from '@plone/volto/actions'; -import { getBaseUrl } from '@plone/volto/helpers'; + getHistory, + revertHistory, +} from '@plone/volto/actions/history/history'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/LinkMore/LinkMore.jsx b/packages/volto/src/components/manage/LinkMore/LinkMore.jsx index cec56fb6d7..65635fbfc9 100644 --- a/packages/volto/src/components/manage/LinkMore/LinkMore.jsx +++ b/packages/volto/src/components/manage/LinkMore/LinkMore.jsx @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { isInternalURL } from '@plone/volto/helpers/Url/Url'; -import { ConditionalLink, UniversalLink } from '@plone/volto/components'; +import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url'; +import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const LinkMore = ({ data, isEditMode }) => { let href = data.linkHref?.[0]?.['@id'] || ''; diff --git a/packages/volto/src/components/manage/LinksToItem/LinksToItem.jsx b/packages/volto/src/components/manage/LinksToItem/LinksToItem.jsx index 0884be01f7..c0cb14ea2d 100644 --- a/packages/volto/src/components/manage/LinksToItem/LinksToItem.jsx +++ b/packages/volto/src/components/manage/LinksToItem/LinksToItem.jsx @@ -3,24 +3,24 @@ * @module components/manage/LinksToItem/LinksToItem */ import React, { useEffect, useState } from 'react'; -import { find } from 'lodash'; -import { Helmet } from '@plone/volto/helpers'; +import find from 'lodash/find'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { Link } from 'react-router-dom'; import { createPortal } from 'react-dom'; import { Container, Segment, Table } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { useDispatch, useSelector } from 'react-redux'; -import { getContent, queryRelations, listActions } from '@plone/volto/actions'; -import { asyncConnect } from '@plone/volto/helpers'; +import { getContent } from '@plone/volto/actions/content/content'; +import { queryRelations } from '@plone/volto/actions/relations/relations'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; -import { - Icon as IconNext, - Toolbar, - UniversalLink, - Unauthorized, -} from '@plone/volto/components'; +import IconNext from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import backSVG from '@plone/volto/icons/back.svg'; import settingsSVG from '@plone/volto/icons/settings.svg'; diff --git a/packages/volto/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx b/packages/volto/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx index f845110b82..723af27b3c 100644 --- a/packages/volto/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx +++ b/packages/volto/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx @@ -3,7 +3,8 @@ import { toast } from 'react-toastify'; import { useSelector } from 'react-redux'; import { useLocation } from 'react-router-dom'; import { defineMessages, useIntl } from 'react-intl'; -import { FormattedDate, Toast } from '@plone/volto/components'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import useDeepCompareEffect from 'use-deep-compare-effect'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Messages/Messages.jsx b/packages/volto/src/components/manage/Messages/Messages.jsx index 9bc536b93b..890ec570c8 100644 --- a/packages/volto/src/components/manage/Messages/Messages.jsx +++ b/packages/volto/src/components/manage/Messages/Messages.jsx @@ -1,8 +1,8 @@ import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { Message, Container } from 'semantic-ui-react'; -import { map } from 'lodash'; +import map from 'lodash/map'; -import { removeMessage } from '@plone/volto/actions'; +import { removeMessage } from '@plone/volto/actions/messages/messages'; const Messages = () => { const dispatch = useDispatch(); diff --git a/packages/volto/src/components/manage/Multilingual/CompareLanguages.jsx b/packages/volto/src/components/manage/Multilingual/CompareLanguages.jsx index 87d19296b7..6ded4ab385 100644 --- a/packages/volto/src/components/manage/Multilingual/CompareLanguages.jsx +++ b/packages/volto/src/components/manage/Multilingual/CompareLanguages.jsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import config from '@plone/volto/registry'; -import { langmap, useDetectClickOutside } from '@plone/volto/helpers'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; +import { useDetectClickOutside } from '@plone/volto/helpers/Utils/useDetectClickOutside'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; import translateSVG from '@plone/volto/icons/translate.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Multilingual/CreateTranslation.jsx b/packages/volto/src/components/manage/Multilingual/CreateTranslation.jsx index 24371546c7..fcd7c58328 100644 --- a/packages/volto/src/components/manage/Multilingual/CreateTranslation.jsx +++ b/packages/volto/src/components/manage/Multilingual/CreateTranslation.jsx @@ -1,12 +1,11 @@ import React from 'react'; import { Redirect } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; -import { - changeLanguage, - getTranslationLocator, - getContent, -} from '@plone/volto/actions'; -import { flattenToAppURL, toGettextLang } from '@plone/volto/helpers'; +import { changeLanguage } from '@plone/volto/actions/language/language'; +import { getTranslationLocator } from '@plone/volto/actions/translations/translations'; +import { getContent } from '@plone/volto/actions/content/content'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { toGettextLang } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; const CreateTranslation = (props) => { diff --git a/packages/volto/src/components/manage/Multilingual/ManageTranslations.jsx b/packages/volto/src/components/manage/Multilingual/ManageTranslations.jsx index 37fe9a11dc..6e6a871b53 100644 --- a/packages/volto/src/components/manage/Multilingual/ManageTranslations.jsx +++ b/packages/volto/src/components/manage/Multilingual/ManageTranslations.jsx @@ -1,18 +1,21 @@ import React, { useEffect, useState } from 'react'; import { Button, Container, Segment, Table } from 'semantic-ui-react'; -import { Helmet } from '@plone/volto/helpers'; -import { flattenToAppURL, getBaseUrl, langmap } from '@plone/volto/helpers'; -import { reduce } from 'lodash'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; +import reduce from 'lodash/reduce'; import { Link, useLocation } from 'react-router-dom'; -import { Icon, Toast, Toolbar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; import config from '@plone/volto/registry'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; import { deleteLinkTranslation, - getContent, linkTranslation, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/translations/translations'; +import { getContent } from '@plone/volto/actions/content/content'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useSelector, useDispatch } from 'react-redux'; import { createPortal } from 'react-dom'; diff --git a/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx b/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx index 6b00724adf..3fc2476a8a 100644 --- a/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx +++ b/packages/volto/src/components/manage/Multilingual/TranslationObject.jsx @@ -1,18 +1,18 @@ import React, { useEffect, useState } from 'react'; -import { map } from 'lodash'; +import map from 'lodash/map'; 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/manage/Form'; import config from '@plone/volto/registry'; import configureStore from '@plone/volto/store'; +import Api from '@plone/volto/helpers/Api/Api'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; import { - Api, - flattenToAppURL, - langmap, toGettextLang, toReactIntlLang, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Utils/Utils'; import { createBrowserHistory } from 'history'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Pluggable/index.js b/packages/volto/src/components/manage/Pluggable/index.js index cfc6bb241b..ab53fa9873 100644 --- a/packages/volto/src/components/manage/Pluggable/index.js +++ b/packages/volto/src/components/manage/Pluggable/index.js @@ -2,7 +2,7 @@ // We've renamed Slot => Pluggable, not to clash with Volto slots import React from 'react'; -import { sortBy } from 'lodash'; +import sortBy from 'lodash/sortBy'; export const context = React.createContext(); diff --git a/packages/volto/src/components/manage/Preferences/ChangePassword.jsx b/packages/volto/src/components/manage/Preferences/ChangePassword.jsx index 62c87e13b2..877284a9d7 100644 --- a/packages/volto/src/components/manage/Preferences/ChangePassword.jsx +++ b/packages/volto/src/components/manage/Preferences/ChangePassword.jsx @@ -6,11 +6,14 @@ import { Container } from 'semantic-ui-react'; import jwtDecode from 'jwt-decode'; import { toast } from 'react-toastify'; -import { Helmet } from '@plone/volto/helpers'; -import { useClient } from '@plone/volto/hooks'; -import { Form, Icon, Toast, Toolbar } from '@plone/volto/components'; -import { updatePassword } from '@plone/volto/actions'; -import { getBaseUrl } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { useClient } from '@plone/volto/hooks/client/useClient'; +import { Form } from '@plone/volto/components/manage/Form'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import { updatePassword } from '@plone/volto/actions/users/users'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import backSVG from '@plone/volto/icons/back.svg'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx b/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx index 3753689e61..8c1ece79c9 100644 --- a/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx +++ b/packages/volto/src/components/manage/Preferences/PersonalInformation.jsx @@ -5,10 +5,11 @@ import { useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; import jwtDecode from 'jwt-decode'; import { toast } from 'react-toastify'; -import { messages } from '@plone/volto/helpers'; -import { Toast } from '@plone/volto/components'; +import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; -import { getUser, updateUser, getUserSchema } from '@plone/volto/actions'; +import { getUser, updateUser } from '@plone/volto/actions/users/users'; +import { getUserSchema } from '@plone/volto/actions/userschema/userschema'; const PersonalInformation = (props) => { const intl = useIntl(); diff --git a/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx b/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx index 2941189d20..d35080c527 100644 --- a/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx +++ b/packages/volto/src/components/manage/Preferences/PersonalPreferences.jsx @@ -1,16 +1,17 @@ import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; -import { map, keys } from 'lodash'; +import map from 'lodash/map'; +import keys from 'lodash/keys'; import { defineMessages, useIntl } from 'react-intl'; import { toast } from 'react-toastify'; import { compose } from 'redux'; import { withCookies } from 'react-cookie'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; import languages from '@plone/volto/constants/Languages.cjs'; -import { changeLanguage } from '@plone/volto/actions'; -import { toGettextLang } from '@plone/volto/helpers'; +import { changeLanguage } from '@plone/volto/actions/language/language'; +import { toGettextLang } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Rules/Rules.jsx b/packages/volto/src/components/manage/Rules/Rules.jsx index f47c14c567..e8b4837aa4 100644 --- a/packages/volto/src/components/manage/Rules/Rules.jsx +++ b/packages/volto/src/components/manage/Rules/Rules.jsx @@ -4,7 +4,7 @@ */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; @@ -19,7 +19,7 @@ import { } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import { addRule, getRules, @@ -28,15 +28,16 @@ import { applyRulesToSubfolders, unapplyRulesToSubfolders, removeRules, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/rules/rules'; -import { Icon, Toolbar } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; import backSVG from '@plone/volto/icons/back.svg'; import checkSVG from '@plone/volto/icons/check.svg'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; const messages = defineMessages({ back: { diff --git a/packages/volto/src/components/manage/Sharing/Sharing.jsx b/packages/volto/src/components/manage/Sharing/Sharing.jsx index b50ece9658..e1fc93099d 100644 --- a/packages/volto/src/components/manage/Sharing/Sharing.jsx +++ b/packages/volto/src/components/manage/Sharing/Sharing.jsx @@ -5,11 +5,13 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Plug, Pluggable } from '@plone/volto/components/manage/Pluggable'; -import { Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link, withRouter } from 'react-router-dom'; -import { find, isEqual, map } from 'lodash'; +import find from 'lodash/find'; +import isEqual from 'lodash/isEqual'; +import map from 'lodash/map'; import { createPortal } from 'react-dom'; import { Button, @@ -24,9 +26,14 @@ import { import jwtDecode from 'jwt-decode'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; -import { updateSharing, getSharing } from '@plone/volto/actions'; -import { getBaseUrl } from '@plone/volto/helpers'; -import { Icon, Toolbar, Toast } from '@plone/volto/components'; +import { + updateSharing, + getSharing, +} from '@plone/volto/actions/sharing/sharing'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { toast } from 'react-toastify'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Sidebar/AlignBlock.jsx b/packages/volto/src/components/manage/Sidebar/AlignBlock.jsx index 67af301d35..8b6407f1c4 100644 --- a/packages/volto/src/components/manage/Sidebar/AlignBlock.jsx +++ b/packages/volto/src/components/manage/Sidebar/AlignBlock.jsx @@ -1,5 +1,5 @@ import { defineMessages, useIntl } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; import imageLeftSVG from '@plone/volto/icons/image-left.svg'; import imageRightSVG from '@plone/volto/icons/image-right.svg'; diff --git a/packages/volto/src/components/manage/Sidebar/ObjectBrowser.jsx b/packages/volto/src/components/manage/Sidebar/ObjectBrowser.jsx index a509550b95..cae778ef48 100644 --- a/packages/volto/src/components/manage/Sidebar/ObjectBrowser.jsx +++ b/packages/volto/src/components/manage/Sidebar/ObjectBrowser.jsx @@ -1,7 +1,7 @@ import React from 'react'; import ObjectBrowserBody from '@plone/volto/components/manage/Sidebar/ObjectBrowserBody'; import SidebarPopup from '@plone/volto/components/manage/Sidebar/SidebarPopup'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; const withObjectBrowser = (WrappedComponent) => class extends React.Component { diff --git a/packages/volto/src/components/manage/Sidebar/ObjectBrowserBody.jsx b/packages/volto/src/components/manage/Sidebar/ObjectBrowserBody.jsx index 7ce0d3d455..cc16cca5c4 100644 --- a/packages/volto/src/components/manage/Sidebar/ObjectBrowserBody.jsx +++ b/packages/volto/src/components/manage/Sidebar/ObjectBrowserBody.jsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; import { Input, Segment, Breadcrumb } from 'semantic-ui-react'; -import { join } from 'lodash'; +import join from 'lodash/join'; // These absolute imports (without using the corresponding centralized index.js) are required // to cut circular import problems, this file should never use them. This is because of diff --git a/packages/volto/src/components/manage/Sidebar/ObjectBrowserNav.jsx b/packages/volto/src/components/manage/Sidebar/ObjectBrowserNav.jsx index bcecef9bda..3a6db8f3c5 100644 --- a/packages/volto/src/components/manage/Sidebar/ObjectBrowserNav.jsx +++ b/packages/volto/src/components/manage/Sidebar/ObjectBrowserNav.jsx @@ -3,7 +3,8 @@ import { Button, Segment, Popup } from 'semantic-ui-react'; import { useIntl, defineMessages } from 'react-intl'; import cx from 'classnames'; import Icon from '@plone/volto/components/theme/Icon/Icon'; -import { flattenToAppURL, getContentIcon } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { getContentIcon } from '@plone/volto/helpers/Content/Content'; import config from '@plone/volto/registry'; import rightArrowSVG from '@plone/volto/icons/right-key.svg'; diff --git a/packages/volto/src/components/manage/Sidebar/Sidebar.jsx b/packages/volto/src/components/manage/Sidebar/Sidebar.jsx index 57a7badc7d..9e2943b7af 100644 --- a/packages/volto/src/components/manage/Sidebar/Sidebar.jsx +++ b/packages/volto/src/components/manage/Sidebar/Sidebar.jsx @@ -6,10 +6,11 @@ import { compose } from 'redux'; import { withCookies } from 'react-cookie'; import { defineMessages, useIntl } from 'react-intl'; import cx from 'classnames'; -import { BodyClass, getCookieOptions } from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import forbiddenSVG from '@plone/volto/icons/forbidden.svg'; -import { setSidebarTab } from '@plone/volto/actions'; +import { setSidebarTab } from '@plone/volto/actions/sidebar/sidebar'; import expandSVG from '@plone/volto/icons/left-key.svg'; import collapseSVG from '@plone/volto/icons/right-key.svg'; diff --git a/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx b/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx index 5c08377b7e..382936828b 100644 --- a/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx +++ b/packages/volto/src/components/manage/Sidebar/SidebarPopup.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { createPortal } from 'react-dom'; import { CSSTransition } from 'react-transition-group'; import PropTypes from 'prop-types'; -import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib'; +import doesNodeContainClick from 'semantic-ui-react/dist/commonjs/lib/doesNodeContainClick'; const DEFAULT_TIMEOUT = 500; diff --git a/packages/volto/src/components/manage/TextLineEdit/TextLineEdit.jsx b/packages/volto/src/components/manage/TextLineEdit/TextLineEdit.jsx index ca6212b06a..54d845e5a5 100644 --- a/packages/volto/src/components/manage/TextLineEdit/TextLineEdit.jsx +++ b/packages/volto/src/components/manage/TextLineEdit/TextLineEdit.jsx @@ -3,7 +3,7 @@ import { Editor, Node, Transforms, Range, createEditor } from 'slate'; import { ReactEditor, Editable, Slate, withReact } from 'slate-react'; import PropTypes from 'prop-types'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import config from '@plone/volto/registry'; import { P } from '@plone/volto-slate/constants'; import cx from 'classnames'; diff --git a/packages/volto/src/components/manage/Toolbar/More.jsx b/packages/volto/src/components/manage/Toolbar/More.jsx index cef48d19cc..07d8bc7c5d 100644 --- a/packages/volto/src/components/manage/Toolbar/More.jsx +++ b/packages/volto/src/components/manage/Toolbar/More.jsx @@ -3,23 +3,22 @@ import { defineMessages, useIntl } from 'react-intl'; import PropTypes from 'prop-types'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { Link, useHistory } from 'react-router-dom'; -import { find } from 'lodash'; +import find from 'lodash/find'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Pluggable, Plug } from '@plone/volto/components/manage/Pluggable'; -import { - FormattedDate, - Icon, - Display, - Workflow, -} from '@plone/volto/components'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Display from '@plone/volto/components/manage/Display/Display'; +import Workflow from '@plone/volto/components/manage/Workflow/Workflow'; import { applyWorkingCopy, createWorkingCopy, removeWorkingCopy, -} from '@plone/volto/actions'; -import { flattenToAppURL, getBaseUrl, usePrevious } from '@plone/volto/helpers'; +} from '@plone/volto/actions/workingcopy/workingcopy'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import config from '@plone/volto/registry'; import rightArrowSVG from '@plone/volto/icons/right-key.svg'; import userSVG from '@plone/volto/icons/user.svg'; diff --git a/packages/volto/src/components/manage/Toolbar/PersonalTools.jsx b/packages/volto/src/components/manage/Toolbar/PersonalTools.jsx index 7d98a568d1..ff2569ec6a 100644 --- a/packages/volto/src/components/manage/Toolbar/PersonalTools.jsx +++ b/packages/volto/src/components/manage/Toolbar/PersonalTools.jsx @@ -6,10 +6,10 @@ import jwtDecode from 'jwt-decode'; import cx from 'classnames'; import { FormattedMessage, useIntl, defineMessages } from 'react-intl'; -import { Icon } from '@plone/volto/components'; -import { getUser } from '@plone/volto/actions'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { getUser } from '@plone/volto/actions/users/users'; import { Pluggable } from '@plone/volto/components/manage/Pluggable'; -import { expandToBackendURL, getBaseUrl } from '@plone/volto/helpers'; +import { expandToBackendURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; import logoutSVG from '@plone/volto/icons/log-out.svg'; import rightArrowSVG from '@plone/volto/icons/right-key.svg'; import backSVG from '@plone/volto/icons/back.svg'; diff --git a/packages/volto/src/components/manage/Toolbar/StandardWrapper.jsx b/packages/volto/src/components/manage/Toolbar/StandardWrapper.jsx index 73227329af..b593e72d75 100644 --- a/packages/volto/src/components/manage/Toolbar/StandardWrapper.jsx +++ b/packages/volto/src/components/manage/Toolbar/StandardWrapper.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import backSVG from '@plone/volto/icons/back.svg'; const StandardWrapper = (props) => { diff --git a/packages/volto/src/components/manage/Toolbar/Toolbar.jsx b/packages/volto/src/components/manage/Toolbar/Toolbar.jsx index 170eaabf7e..2dd62f5b80 100644 --- a/packages/volto/src/components/manage/Toolbar/Toolbar.jsx +++ b/packages/volto/src/components/manage/Toolbar/Toolbar.jsx @@ -10,9 +10,10 @@ import { Link } from 'react-router-dom'; import jwtDecode from 'jwt-decode'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib'; +import doesNodeContainClick from 'semantic-ui-react/dist/commonjs/lib/doesNodeContainClick'; import { withCookies } from 'react-cookie'; -import { filter, find } from 'lodash'; +import filter from 'lodash/filter'; +import find from 'lodash/find'; import cx from 'classnames'; import config from '@plone/volto/registry'; @@ -22,19 +23,15 @@ import Types from '@plone/volto/components/manage/Toolbar/Types'; import PersonalInformation from '@plone/volto/components/manage/Preferences/PersonalInformation'; import PersonalPreferences from '@plone/volto/components/manage/Preferences/PersonalPreferences'; import StandardWrapper from '@plone/volto/components/manage/Toolbar/StandardWrapper'; -import { - getTypes, - listActions, - setExpandedToolbar, - unlockContent, -} from '@plone/volto/actions'; -import { Icon } from '@plone/volto/components'; -import { - BodyClass, - getBaseUrl, - getCookieOptions, - hasApiExpander, -} from '@plone/volto/helpers'; +import { getTypes } from '@plone/volto/actions/types/types'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import { setExpandedToolbar } from '@plone/volto/actions/toolbar/toolbar'; +import { unlockContent } from '@plone/volto/actions/content/content'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import { Pluggable } from '@plone/volto/components/manage/Pluggable'; import penSVG from '@plone/volto/icons/pen.svg'; diff --git a/packages/volto/src/components/manage/Toolbar/Types.jsx b/packages/volto/src/components/manage/Toolbar/Types.jsx index a47abd50c2..83cad9f2f1 100644 --- a/packages/volto/src/components/manage/Toolbar/Types.jsx +++ b/packages/volto/src/components/manage/Toolbar/Types.jsx @@ -2,9 +2,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; -import { filter, find, isEmpty, map } from 'lodash'; +import filter from 'lodash/filter'; +import find from 'lodash/find'; +import isEmpty from 'lodash/isEmpty'; +import map from 'lodash/map'; import { FormattedMessage } from 'react-intl'; -import { flattenToAppURL, langmap, toBackendLang } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; const Types = ({ types, pathname, content, currentLanguage }) => { diff --git a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx index dc361195b3..dab923edde 100644 --- a/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ArrayWidget.jsx @@ -9,14 +9,15 @@ import PropTypes from 'prop-types'; import { compose } from 'redux'; import { connect } from 'react-redux'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; -import { find, isObject } from 'lodash'; +import find from 'lodash/find'; +import isObject from 'lodash/isObject'; import { getVocabFromHint, getVocabFromField, getVocabFromItems, -} from '@plone/volto/helpers'; -import { getVocabulary } from '@plone/volto/actions'; +} from '@plone/volto/helpers/Vocabularies/Vocabularies'; +import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies'; import { Option, diff --git a/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx b/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx index 6b9b940e69..32c54a3287 100644 --- a/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ButtonsWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { Button } from 'semantic-ui-react'; // The ButtonsWidget diff --git a/packages/volto/src/components/manage/Widgets/ColorPickerWidget.tsx b/packages/volto/src/components/manage/Widgets/ColorPickerWidget.tsx index b8d44b1530..3e473ae2aa 100644 --- a/packages/volto/src/components/manage/Widgets/ColorPickerWidget.tsx +++ b/packages/volto/src/components/manage/Widgets/ColorPickerWidget.tsx @@ -1,7 +1,8 @@ import React from 'react'; import { Form } from 'semantic-ui-react'; import { Grid, Button } from 'semantic-ui-react'; -import { isEmpty, isEqual } from 'lodash'; +import isEmpty from 'lodash/isEmpty'; +import isEqual from 'lodash/isEqual'; import { defineMessages, useIntl } from 'react-intl'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx b/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx index bfa4cfe6fb..c6a708d729 100644 --- a/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/DatetimeWidget.jsx @@ -3,9 +3,9 @@ import PropTypes from 'prop-types'; import { defineMessages, useIntl } from 'react-intl'; import loadable from '@loadable/component'; import cx from 'classnames'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { parseDateTime, toBackendLang } from '@plone/volto/helpers'; +import { parseDateTime, toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import leftKey from '@plone/volto/icons/left-key.svg'; diff --git a/packages/volto/src/components/manage/Widgets/FileWidget.jsx b/packages/volto/src/components/manage/Widgets/FileWidget.jsx index e21cde8c60..9579711224 100644 --- a/packages/volto/src/components/manage/Widgets/FileWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/FileWidget.jsx @@ -9,10 +9,12 @@ 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, UniversalLink } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; import loadable from '@loadable/component'; -import { flattenToAppURL, validateFileUploadSize } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; import { defineMessages, useIntl } from 'react-intl'; const imageMimetypes = [ diff --git a/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx b/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx index 732b4ba281..dcdbe0106e 100644 --- a/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx +++ b/packages/volto/src/components/manage/Widgets/FormFieldWrapper.jsx @@ -5,11 +5,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Form, Grid, Icon as IconOld, Label } from 'semantic-ui-react'; -import { map } from 'lodash'; +import map from 'lodash/map'; import cx from 'classnames'; import { defineMessages, injectIntl } from 'react-intl'; import LanguageSVG from '@plone/volto/icons/language.svg'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; const messages = defineMessages({ edit: { diff --git a/packages/volto/src/components/manage/Widgets/IdWidget.jsx b/packages/volto/src/components/manage/Widgets/IdWidget.jsx index 11c4f23a68..c1ada3b41c 100644 --- a/packages/volto/src/components/manage/Widgets/IdWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/IdWidget.jsx @@ -7,13 +7,17 @@ import { useState, useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; import { useSelector, useDispatch } from 'react-redux'; import { Input } from 'semantic-ui-react'; -import { compact, concat, map, union, uniq } from 'lodash'; +import compact from 'lodash/compact'; +import concat from 'lodash/concat'; +import map from 'lodash/map'; +import union from 'lodash/union'; +import uniq from 'lodash/uniq'; import { defineMessages, useIntl } from 'react-intl'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; import config from '@plone/volto/registry'; -import { getQuerystring } from '@plone/volto/actions'; +import { getQuerystring } from '@plone/volto/actions/querystring/querystring'; const messages = defineMessages({ reservedId: { diff --git a/packages/volto/src/components/manage/Widgets/ImageWidget.jsx b/packages/volto/src/components/manage/Widgets/ImageWidget.jsx index b107e74307..8d37c93cf7 100644 --- a/packages/volto/src/components/manage/Widgets/ImageWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ImageWidget.jsx @@ -13,12 +13,13 @@ import { flattenToAppURL, getBaseUrl, isInternalURL, - validateFileUploadSize, - usePrevious, -} from '@plone/volto/helpers'; -import { createContent } from '@plone/volto/actions'; +} from '@plone/volto/helpers/Url/Url'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { createContent } from '@plone/volto/actions/content/content'; import { readAsDataURL } from 'promise-file-reader'; -import { FormFieldWrapper, Icon } from '@plone/volto/components'; +import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx b/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx index 9d562a62cc..d09d592c18 100644 --- a/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/InternalUrlWidget.jsx @@ -6,9 +6,13 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { Input, Button } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { isInternalURL, flattenToAppURL, URLUtils } from '@plone/volto/helpers'; +import { + isInternalURL, + flattenToAppURL, + URLUtils, +} from '@plone/volto/helpers/Url/Url'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; import clearSVG from '@plone/volto/icons/clear.svg'; import navTreeSVG from '@plone/volto/icons/nav.svg'; diff --git a/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.jsx b/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.jsx index 566928561c..affb208a83 100644 --- a/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.jsx @@ -6,7 +6,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { compose } from 'redux'; -import { compact, includes, isArray, isEmpty, remove } from 'lodash'; +import compact from 'lodash/compact'; +import includes from 'lodash/includes'; +import isArray from 'lodash/isArray'; +import isEmpty from 'lodash/isEmpty'; +import remove from 'lodash/remove'; import { connect } from 'react-redux'; import { Image, Label, Popup, Button } from 'semantic-ui-react'; import { diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx b/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx index 2cc78da16e..7783ea84c8 100644 --- a/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ObjectListWidget.jsx @@ -1,9 +1,11 @@ import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Accordion, Button, Segment } from 'semantic-ui-react'; -import { DragDropList, Icon } from '@plone/volto/components'; +import DragDropList from '@plone/volto/components/manage/DragDropList/DragDropList'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { applySchemaDefaults, reorderArray } from '@plone/volto/helpers'; +import { applySchemaDefaults } from '@plone/volto/helpers/Blocks/Blocks'; +import { reorderArray } from '@plone/volto/helpers/Utils/Utils'; import ObjectWidget from '@plone/volto/components/manage/Widgets/ObjectWidget'; import upSVG from '@plone/volto/icons/up-key.svg'; diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js b/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js index 72518ce27e..5e4fc17717 100644 --- a/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js +++ b/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js @@ -3,7 +3,7 @@ import { RealStoreWrapper, FormUndoWrapper } from '@plone/volto/storybook'; import React from 'react'; import { searchResults } from './ObjectBrowserWidget.stories'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; const defaultSchema = { title: 'Item', diff --git a/packages/volto/src/components/manage/Widgets/ObjectWidget.stories.jsx b/packages/volto/src/components/manage/Widgets/ObjectWidget.stories.jsx index 006d395995..8102bb0a2f 100644 --- a/packages/volto/src/components/manage/Widgets/ObjectWidget.stories.jsx +++ b/packages/volto/src/components/manage/Widgets/ObjectWidget.stories.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { searchResults } from './ObjectBrowserWidget.stories'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import ObjectWidget from './ObjectWidget'; import WidgetStory from './story'; diff --git a/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx b/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx index 7255b88aba..807f5356ad 100644 --- a/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/QuerySortOnWidget.jsx @@ -1,6 +1,8 @@ import React from 'react'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { toPairs, groupBy, map } from 'lodash'; +import toPairs from 'lodash/toPairs'; +import groupBy from 'lodash/groupBy'; +import map from 'lodash/map'; import { defineMessages, useIntl } from 'react-intl'; import { useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/manage/Widgets/QueryWidget.jsx b/packages/volto/src/components/manage/Widgets/QueryWidget.jsx index 1c06d998cb..f648aa04d1 100644 --- a/packages/volto/src/components/manage/Widgets/QueryWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/QueryWidget.jsx @@ -8,10 +8,15 @@ import PropTypes from 'prop-types'; import { compose } from 'redux'; import { connect } from 'react-redux'; import { Button, Form, Grid, Input, Label } from 'semantic-ui-react'; -import { filter, remove, toPairs, groupBy, isEmpty, map } from 'lodash'; +import filter from 'lodash/filter'; +import remove from 'lodash/remove'; +import toPairs from 'lodash/toPairs'; +import groupBy from 'lodash/groupBy'; +import isEmpty from 'lodash/isEmpty'; +import map from 'lodash/map'; import { defineMessages, injectIntl } from 'react-intl'; -import { getQuerystring } from '@plone/volto/actions'; -import { Icon } from '@plone/volto/components'; +import { getQuerystring } from '@plone/volto/actions/querystring/querystring'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import cx from 'classnames'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/ByDayField.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/ByDayField.jsx index bd8119a9ac..7491ab4012 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/ByDayField.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/ByDayField.jsx @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Form, Grid, Button } from 'semantic-ui-react'; import { Days } from './Utils'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/MonthOfTheYearField.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/MonthOfTheYearField.jsx index 85d9e25cd7..f3b39f770a 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/MonthOfTheYearField.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/MonthOfTheYearField.jsx @@ -5,10 +5,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { Form } from 'semantic-ui-react'; import SelectInput from './SelectInput'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/Occurences.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/Occurences.jsx index 47314b0a10..4805ded358 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/Occurences.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/Occurences.jsx @@ -8,10 +8,10 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import cx from 'classnames'; import { List, Button, Header, Label } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import addSVG from '@plone/volto/icons/circle-plus.svg'; import trashSVG from '@plone/volto/icons/delete.svg'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; 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 e7c2f03f0f..10821679d0 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx @@ -9,7 +9,11 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import cx from 'classnames'; -import { isEqual, map, find, concat, remove } from 'lodash'; +import isEqual from 'lodash/isEqual'; +import map from 'lodash/map'; +import find from 'lodash/find'; +import concat from 'lodash/concat'; +import remove from 'lodash/remove'; import { defineMessages, injectIntl } from 'react-intl'; import { Form, @@ -21,10 +25,10 @@ import { Header, } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; 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 { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import saveSVG from '@plone/volto/icons/save.svg'; diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx index a3165c2280..fdb6a70bef 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/SelectInput.jsx @@ -5,7 +5,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { find } from 'lodash'; +import find from 'lodash/find'; import { Option, DropdownIndicator, diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthField.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthField.jsx index 6d726a0292..59ca09311e 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthField.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthField.jsx @@ -4,11 +4,11 @@ */ import React from 'react'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { Days } from './Utils'; import SelectInput from './SelectInput'; import { Form } from 'semantic-ui-react'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx index d75defb5a0..639a5a357d 100644 --- a/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +++ b/packages/volto/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx @@ -6,7 +6,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { Form } from 'semantic-ui-react'; import SelectInput from './SelectInput'; diff --git a/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx b/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx index 93f90c9f1c..990b081945 100644 --- a/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/ReferenceWidget.jsx @@ -2,12 +2,20 @@ import { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { Label, Dropdown, Popup, Icon } from 'semantic-ui-react'; -import { compact, concat, fromPairs, map, values, uniqBy } from 'lodash'; +import compact from 'lodash/compact'; +import concat from 'lodash/concat'; +import fromPairs from 'lodash/fromPairs'; +import map from 'lodash/map'; +import values from 'lodash/values'; +import uniqBy from 'lodash/uniqBy'; import { defineMessages, useIntl } from 'react-intl'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { resetSearchContent, searchContent } from '@plone/volto/actions'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { + resetSearchContent, + searchContent, +} from '@plone/volto/actions/search/search'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; const messages = defineMessages({ no_results_found: { diff --git a/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx b/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx index b33aebac0c..0ec4367a36 100644 --- a/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/RegistryImageWidget.jsx @@ -9,11 +9,12 @@ 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 } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; 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'; +import { toPublicURL } from '@plone/volto/helpers/Url/Url'; +import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation'; const imageMimetypes = [ 'image/png', diff --git a/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx b/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx index 0bf9c45d91..e7c8f8b6e2 100644 --- a/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/SchemaWidget.jsx @@ -7,7 +7,13 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { compose } from 'redux'; import PropTypes from 'prop-types'; -import { concat, findIndex, isString, map, omit, slice, without } from 'lodash'; +import concat from 'lodash/concat'; +import findIndex from 'lodash/findIndex'; +import isString from 'lodash/isString'; +import map from 'lodash/map'; +import omit from 'lodash/omit'; +import slice from 'lodash/slice'; +import without from 'lodash/without'; import move from 'lodash-move'; import { Confirm, Form, Grid, Icon, Message, Segment } from 'semantic-ui-react'; import { defineMessages, injectIntl } from 'react-intl'; diff --git a/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx b/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx index a90f643b06..a6eac067b6 100644 --- a/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx +++ b/packages/volto/src/components/manage/Widgets/SelectAutoComplete.jsx @@ -19,8 +19,11 @@ import { getVocabFromHint, getVocabFromField, getVocabFromItems, -} from '@plone/volto/helpers'; -import { getVocabulary, getVocabularyTokenTitle } from '@plone/volto/actions'; +} from '@plone/volto/helpers/Vocabularies/Vocabularies'; +import { + getVocabulary, + getVocabularyTokenTitle, +} from '@plone/volto/actions/vocabularies/vocabularies'; import { Option, diff --git a/packages/volto/src/components/manage/Widgets/SelectStyling.jsx b/packages/volto/src/components/manage/Widgets/SelectStyling.jsx index a9c337f9ab..c78a957b87 100644 --- a/packages/volto/src/components/manage/Widgets/SelectStyling.jsx +++ b/packages/volto/src/components/manage/Widgets/SelectStyling.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { Popup } from 'semantic-ui-react'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import DynamicHeightList from '@plone/volto/components/manage/ReactVirtualized/DynamicRowHeightList'; import downSVG from '@plone/volto/icons/down-key.svg'; diff --git a/packages/volto/src/components/manage/Widgets/SelectUtils.js b/packages/volto/src/components/manage/Widgets/SelectUtils.js index b5ad063c6c..3cc474544e 100644 --- a/packages/volto/src/components/manage/Widgets/SelectUtils.js +++ b/packages/volto/src/components/manage/Widgets/SelectUtils.js @@ -1,5 +1,7 @@ -import { isBoolean, isObject, isString } from 'lodash'; -import { getBoolean } from '@plone/volto/helpers'; +import isBoolean from 'lodash/isBoolean'; +import isObject from 'lodash/isObject'; +import isString from 'lodash/isString'; +import { getBoolean } from '@plone/volto/helpers/Vocabularies/Vocabularies'; import { defineMessages } from 'react-intl'; const messages = defineMessages({ diff --git a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx index 0c9d61e12f..2321903b69 100644 --- a/packages/volto/src/components/manage/Widgets/SelectWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/SelectWidget.jsx @@ -7,15 +7,18 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { defineMessages, injectIntl } from 'react-intl'; import { getVocabFromHint, getVocabFromField, getVocabFromItems, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Vocabularies/Vocabularies'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; -import { getVocabulary, getVocabularyTokenTitle } from '@plone/volto/actions'; +import { + getVocabulary, + getVocabularyTokenTitle, +} from '@plone/volto/actions/vocabularies/vocabularies'; import { normalizeValue } from '@plone/volto/components/manage/Widgets/SelectUtils'; import { diff --git a/packages/volto/src/components/manage/Widgets/SelectWidget.stories.jsx b/packages/volto/src/components/manage/Widgets/SelectWidget.stories.jsx index caa7fbc4d1..5d646b7408 100644 --- a/packages/volto/src/components/manage/Widgets/SelectWidget.stories.jsx +++ b/packages/volto/src/components/manage/Widgets/SelectWidget.stories.jsx @@ -4,7 +4,7 @@ import WidgetStory from './story'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import checkSVG from '@plone/volto/icons/check.svg'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import bellRingingSVG from '@plone/volto/icons/bell-ringing.svg'; import blogSVG from '@plone/volto/icons/blog.svg'; diff --git a/packages/volto/src/components/manage/Widgets/TextWidget.jsx b/packages/volto/src/components/manage/Widgets/TextWidget.jsx index 37f4c0c957..5a13d34373 100644 --- a/packages/volto/src/components/manage/Widgets/TextWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/TextWidget.jsx @@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; import { Input } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; const TextWidget = (props) => { diff --git a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx index cad1f0bdcb..e29f94ac3a 100644 --- a/packages/volto/src/components/manage/Widgets/TokenWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/TokenWidget.jsx @@ -12,8 +12,8 @@ import { getVocabFromHint, getVocabFromField, getVocabFromItems, -} from '@plone/volto/helpers'; -import { getVocabulary } from '@plone/volto/actions'; +} from '@plone/volto/helpers/Vocabularies/Vocabularies'; +import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies'; import { Option, diff --git a/packages/volto/src/components/manage/Widgets/UrlWidget.jsx b/packages/volto/src/components/manage/Widgets/UrlWidget.jsx index 60e7b348bc..cc256ffe9b 100644 --- a/packages/volto/src/components/manage/Widgets/UrlWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/UrlWidget.jsx @@ -6,14 +6,14 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { Input, Button } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper'; import { addAppURL, isInternalURL, flattenToAppURL, URLUtils, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Url/Url'; import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser'; import clearSVG from '@plone/volto/icons/clear.svg'; import navTreeSVG from '@plone/volto/icons/nav.svg'; diff --git a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx index cfefd80a67..20adda8424 100644 --- a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx +++ b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.jsx @@ -84,16 +84,19 @@ def TalkTypesVocabulary(context): import React from 'react'; import { useDispatch } from 'react-redux'; -import { find, findIndex, remove } from 'lodash'; +import find from 'lodash/find'; +import findIndex from 'lodash/findIndex'; +import remove from 'lodash/remove'; import { defineMessages, useIntl } from 'react-intl'; import { v4 as uuid } from 'uuid'; import { Button } from 'semantic-ui-react'; -import { DragDropList, Icon } from '@plone/volto/components'; +import DragDropList from '@plone/volto/components/manage/DragDropList/DragDropList'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; 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 langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; import deleteSVG from '@plone/volto/icons/delete.svg'; import addSVG from '@plone/volto/icons/add.svg'; diff --git a/packages/volto/src/components/manage/Workflow/Workflow.jsx b/packages/volto/src/components/manage/Workflow/Workflow.jsx index 7185af3b58..4c569a751e 100644 --- a/packages/volto/src/components/manage/Workflow/Workflow.jsx +++ b/packages/volto/src/components/manage/Workflow/Workflow.jsx @@ -2,24 +2,25 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { compose } from 'redux'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; -import { uniqBy } from 'lodash'; +import uniqBy from 'lodash/uniqBy'; import { toast } from 'react-toastify'; import { defineMessages, useIntl } from 'react-intl'; -import { Icon, Toast } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { FormFieldWrapper } from '@plone/volto/components/manage/Widgets'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { - flattenToAppURL, getWorkflowOptions, getCurrentStateMapping, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Workflows/Workflows'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; +import { getContent } from '@plone/volto/actions/content/content'; import { - getContent, getWorkflow, transitionWorkflow, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/workflow/workflow'; import downSVG from '@plone/volto/icons/down-key.svg'; import upSVG from '@plone/volto/icons/up-key.svg'; import checkSVG from '@plone/volto/icons/check.svg'; diff --git a/packages/volto/src/components/manage/WorkingCopyToastsFactory/WorkingCopyToastsFactory.jsx b/packages/volto/src/components/manage/WorkingCopyToastsFactory/WorkingCopyToastsFactory.jsx index 964d6af6a9..07cc48d57d 100644 --- a/packages/volto/src/components/manage/WorkingCopyToastsFactory/WorkingCopyToastsFactory.jsx +++ b/packages/volto/src/components/manage/WorkingCopyToastsFactory/WorkingCopyToastsFactory.jsx @@ -4,9 +4,9 @@ import { toast } from 'react-toastify'; import { useSelector } from 'react-redux'; import { useLocation } from 'react-router-dom'; import { defineMessages, useIntl } from 'react-intl'; -import { Toast } from '@plone/volto/components'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { FormattedDate } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate'; import config from '@plone/volto/registry'; import useDeepCompareEffect from 'use-deep-compare-effect'; diff --git a/packages/volto/src/components/theme/Anontools/Anontools.jsx b/packages/volto/src/components/theme/Anontools/Anontools.jsx index 572680b738..2d32eb030c 100644 --- a/packages/volto/src/components/theme/Anontools/Anontools.jsx +++ b/packages/volto/src/components/theme/Anontools/Anontools.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { Menu } from 'semantic-ui-react'; import { FormattedMessage } from 'react-intl'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; import { useSelector, shallowEqual } from 'react-redux'; diff --git a/packages/volto/src/components/theme/App/App.jsx b/packages/volto/src/components/theme/App/App.jsx index c3076a7fc4..1c900fefe1 100644 --- a/packages/volto/src/components/theme/App/App.jsx +++ b/packages/volto/src/components/theme/App/App.jsx @@ -8,7 +8,8 @@ import jwtDecode from 'jwt-decode'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { asyncConnect, Helmet } from '@plone/volto/helpers'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { Segment } from 'semantic-ui-react'; import { renderRoutes } from 'react-router-config'; import { Slide, ToastContainer, toast } from 'react-toastify'; @@ -23,29 +24,21 @@ import { injectIntl } from 'react-intl'; import Error from '@plone/volto/error'; -import { - Breadcrumbs, - Footer, - Header, - Icon, - OutdatedBrowser, - AppExtras, - SkipLinks, -} from '@plone/volto/components'; -import { - BodyClass, - getBaseUrl, - getView, - hasApiExpander, - isCmsUi, -} from '@plone/volto/helpers'; -import { - getBreadcrumbs, - getContent, - getNavigation, - getTypes, - getWorkflow, -} from '@plone/volto/actions'; +import Breadcrumbs from '@plone/volto/components/theme/Breadcrumbs/Breadcrumbs'; +import Footer from '@plone/volto/components/theme/Footer/Footer'; +import Header from '@plone/volto/components/theme/Header/Header'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import OutdatedBrowser from '@plone/volto/components/theme/OutdatedBrowser/OutdatedBrowser'; +import AppExtras from '@plone/volto/components/theme/AppExtras/AppExtras'; +import SkipLinks from '@plone/volto/components/theme/SkipLinks/SkipLinks'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import { getBaseUrl, getView, isCmsUi } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; +import { getBreadcrumbs } from '@plone/volto/actions/breadcrumbs/breadcrumbs'; +import { getContent } from '@plone/volto/actions/content/content'; +import { getNavigation } from '@plone/volto/actions/navigation/navigation'; +import { getTypes } from '@plone/volto/actions/types/types'; +import { getWorkflow } from '@plone/volto/actions/workflow/workflow'; import clearSVG from '@plone/volto/icons/clear.svg'; import MultilingualRedirector from '@plone/volto/components/theme/MultilingualRedirector/MultilingualRedirector'; diff --git a/packages/volto/src/components/theme/Avatar/Avatar.jsx b/packages/volto/src/components/theme/Avatar/Avatar.jsx index b142b6aa65..58850133e1 100644 --- a/packages/volto/src/components/theme/Avatar/Avatar.jsx +++ b/packages/volto/src/components/theme/Avatar/Avatar.jsx @@ -4,7 +4,7 @@ */ import React from 'react'; import PropTypes from 'prop-types'; -import { getInitials } from '@plone/volto/helpers'; +import { getInitials } from '@plone/volto/helpers/Utils/Utils'; const defaultSize = 30; const defaultColor = 'Teal'; diff --git a/packages/volto/src/components/theme/Breadcrumbs/Breadcrumbs.jsx b/packages/volto/src/components/theme/Breadcrumbs/Breadcrumbs.jsx index 690ad96a0b..1889d64f00 100644 --- a/packages/volto/src/components/theme/Breadcrumbs/Breadcrumbs.jsx +++ b/packages/volto/src/components/theme/Breadcrumbs/Breadcrumbs.jsx @@ -5,9 +5,10 @@ import { Breadcrumb, Container, Segment } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; -import { getBreadcrumbs } from '@plone/volto/actions'; -import { getBaseUrl, hasApiExpander } from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; +import { getBreadcrumbs } from '@plone/volto/actions/breadcrumbs/breadcrumbs'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import homeSVG from '@plone/volto/icons/home.svg'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/Comments/CommentEditModal.jsx b/packages/volto/src/components/theme/Comments/CommentEditModal.jsx index 3400ec83d2..79fb958710 100644 --- a/packages/volto/src/components/theme/Comments/CommentEditModal.jsx +++ b/packages/volto/src/components/theme/Comments/CommentEditModal.jsx @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { defineMessages, useIntl } from 'react-intl'; -import { usePrevious } from '@plone/volto/helpers'; -import { updateComment } from '@plone/volto/actions'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { updateComment } from '@plone/volto/actions/comments/comments'; import { ModalForm } from '@plone/volto/components/manage/Form'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/Comments/Comments.jsx b/packages/volto/src/components/theme/Comments/Comments.jsx index 59fd64d405..e6b1f31412 100644 --- a/packages/volto/src/components/theme/Comments/Comments.jsx +++ b/packages/volto/src/components/theme/Comments/Comments.jsx @@ -12,16 +12,13 @@ import { deleteComment, listComments, listMoreComments, -} from '@plone/volto/actions'; -import { Avatar } from '@plone/volto/components'; +} from '@plone/volto/actions/comments/comments'; +import Avatar from '@plone/volto/components/theme/Avatar/Avatar'; import { Form } from '@plone/volto/components/manage/Form'; import { CommentEditModal } from '@plone/volto/components/theme/Comments'; -import { - flattenToAppURL, - getBaseUrl, - getColor, - usePrevious, -} from '@plone/volto/helpers'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { getColor } from '@plone/volto/helpers/Utils/Utils'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; const messages = defineMessages({ comment: { diff --git a/packages/volto/src/components/theme/ContactForm/ContactForm.jsx b/packages/volto/src/components/theme/ContactForm/ContactForm.jsx index 150db350a4..35c4604bda 100644 --- a/packages/volto/src/components/theme/ContactForm/ContactForm.jsx +++ b/packages/volto/src/components/theme/ContactForm/ContactForm.jsx @@ -5,12 +5,15 @@ import { defineMessages, useIntl } from 'react-intl'; import { Link, useHistory, useLocation } from 'react-router-dom'; import { toast } from 'react-toastify'; -import { emailNotification } from '@plone/volto/actions'; +import { emailNotification } from '@plone/volto/actions/emailNotification/emailNotification'; import { useDispatch, useSelector } from 'react-redux'; -import { Toolbar, Toast } from '@plone/volto/components'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; -import { getBaseUrl, Helmet, usePrevious } from '@plone/volto/helpers'; -import { useClient } from '@plone/volto/hooks'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import { useClient } from '@plone/volto/hooks/client/useClient'; const messages = defineMessages({ send: { diff --git a/packages/volto/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx b/packages/volto/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx index 6a28138144..493c336c5c 100644 --- a/packages/volto/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +++ b/packages/volto/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx @@ -1,11 +1,8 @@ import React, { useEffect } from 'react'; -import { - toPublicURL, - Helmet, - hasApiExpander, - getBaseUrl, -} from '@plone/volto/helpers'; -import { getNavroot } from '@plone/volto/actions'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { toPublicURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; +import { getNavroot } from '@plone/volto/actions/navroot/navroot'; import config from '@plone/volto/registry'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx index e897f4ba49..e1ba3dfb89 100644 --- a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx +++ b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx @@ -5,8 +5,8 @@ import { When, Recurrence, } from '@plone/volto/components/theme/View/EventDatesInfo'; -import { Icon } from '@plone/volto/components'; -import { expandToBackendURL } from '@plone/volto/helpers'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import { expandToBackendURL } from '@plone/volto/helpers/Url/Url'; import calendarSVG from '@plone/volto/icons/calendar.svg'; diff --git a/packages/volto/src/components/theme/Footer/Footer.jsx b/packages/volto/src/components/theme/Footer/Footer.jsx index 6bbabbf87f..678cbbcf61 100644 --- a/packages/volto/src/components/theme/Footer/Footer.jsx +++ b/packages/volto/src/components/theme/Footer/Footer.jsx @@ -5,11 +5,11 @@ import React from 'react'; import { Container, List, Segment } from 'semantic-ui-react'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { useSelector, shallowEqual } from 'react-redux'; -import { UniversalLink } from '@plone/volto/components'; -import { flattenToAppURL, addAppURL } from '@plone/volto/helpers'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import { flattenToAppURL, addAppURL } from '@plone/volto/helpers/Url/Url'; const messages = defineMessages({ copyright: { diff --git a/packages/volto/src/components/theme/Header/Header.jsx b/packages/volto/src/components/theme/Header/Header.jsx index 998cf276c5..39fb3b57d0 100644 --- a/packages/volto/src/components/theme/Header/Header.jsx +++ b/packages/volto/src/components/theme/Header/Header.jsx @@ -2,13 +2,11 @@ import { Container, Segment } from 'semantic-ui-react'; import PropTypes from 'prop-types'; import { useSelector, shallowEqual } from 'react-redux'; -import { - Anontools, - LanguageSelector, - Logo, - Navigation, - SearchWidget, -} from '@plone/volto/components'; +import Anontools from '@plone/volto/components/theme/Anontools/Anontools'; +import LanguageSelector from '@plone/volto/components/theme/LanguageSelector/LanguageSelector'; +import Logo from '@plone/volto/components/theme/Logo/Logo'; +import Navigation from '@plone/volto/components/theme/Navigation/Navigation'; +import SearchWidget from '@plone/volto/components/theme/SearchWidget/SearchWidget'; const Header = ({ pathname }) => { const token = useSelector((state) => state.userSession.token, shallowEqual); diff --git a/packages/volto/src/components/theme/Icon/Icon.stories.jsx b/packages/volto/src/components/theme/Icon/Icon.stories.jsx index 7fde14067b..3ac721bd3d 100644 --- a/packages/volto/src/components/theme/Icon/Icon.stories.jsx +++ b/packages/volto/src/components/theme/Icon/Icon.stories.jsx @@ -33,7 +33,7 @@ export default { // You can load icons from Volto using the `Icon` component: // ```jsx static -// import { Icon } from '@plone/volto/components'; +// import Icon from '@plone/volto/components/theme/Icon/Icon'; // import addIcon from '@plone/volto/icons/add.svg'; // const IconTest = () => ; diff --git a/packages/volto/src/components/theme/Image/Image.jsx b/packages/volto/src/components/theme/Image/Image.jsx index 2cf15cd601..30d2f2cbc4 100644 --- a/packages/volto/src/components/theme/Image/Image.jsx +++ b/packages/volto/src/components/theme/Image/Image.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import cx from 'classnames'; -import { flattenToAppURL, flattenScales } from '@plone/volto/helpers'; +import { flattenToAppURL, flattenScales } from '@plone/volto/helpers/Url/Url'; /** * Image component diff --git a/packages/volto/src/components/theme/LanguageSelector/LanguageSelector.jsx b/packages/volto/src/components/theme/LanguageSelector/LanguageSelector.jsx index 460dec541d..1dc6c65d37 100644 --- a/packages/volto/src/components/theme/LanguageSelector/LanguageSelector.jsx +++ b/packages/volto/src/components/theme/LanguageSelector/LanguageSelector.jsx @@ -9,14 +9,13 @@ import { Link } from 'react-router-dom'; import { useSelector } from 'react-redux'; import cx from 'classnames'; -import { find, map } from 'lodash'; +import find from 'lodash/find'; +import map from 'lodash/map'; -import { - Helmet, - langmap, - flattenToAppURL, - toReactIntlLang, -} from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { toReactIntlLang } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/Login/Login.jsx b/packages/volto/src/components/theme/Login/Login.jsx index 5091ac9ef9..0a9a427acb 100644 --- a/packages/volto/src/components/theme/Login/Login.jsx +++ b/packages/volto/src/components/theme/Login/Login.jsx @@ -12,17 +12,18 @@ import { import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import qs from 'query-string'; -import { Helmet, usePrevious } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import config from '@plone/volto/registry'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import { login, logout, resetLoginRequest, - purgeMessages, -} from '@plone/volto/actions'; +} from '@plone/volto/actions/userSession/userSession'; +import { purgeMessages } from '@plone/volto/actions/messages/messages'; import { toast } from 'react-toastify'; -import { Toast } from '@plone/volto/components'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import aheadSVG from '@plone/volto/icons/ahead.svg'; import clearSVG from '@plone/volto/icons/clear.svg'; diff --git a/packages/volto/src/components/theme/Logo/Logo.jsx b/packages/volto/src/components/theme/Logo/Logo.jsx index d8eebd6e70..e2bb4cd73e 100644 --- a/packages/volto/src/components/theme/Logo/Logo.jsx +++ b/packages/volto/src/components/theme/Logo/Logo.jsx @@ -8,12 +8,9 @@ import { Image } from 'semantic-ui-react'; import LogoImage from '@plone/volto/components/theme/Logo/Logo.svg'; import { useSelector, useDispatch } from 'react-redux'; import { Link, useLocation } from 'react-router-dom'; -import { getNavroot } from '@plone/volto/actions'; -import { - flattenToAppURL, - hasApiExpander, - getBaseUrl, -} from '@plone/volto/helpers'; +import { getNavroot } from '@plone/volto/actions/navroot/navroot'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; /** * Logo component class. diff --git a/packages/volto/src/components/theme/Logout/Logout.jsx b/packages/volto/src/components/theme/Logout/Logout.jsx index 29e175c1a4..bcbfbb0996 100644 --- a/packages/volto/src/components/theme/Logout/Logout.jsx +++ b/packages/volto/src/components/theme/Logout/Logout.jsx @@ -3,8 +3,9 @@ import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { defineMessages, useIntl } from 'react-intl'; import qs from 'query-string'; -import { Toast } from '@plone/volto/components'; -import { logout, purgeMessages } from '@plone/volto/actions'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; +import { logout } from '@plone/volto/actions/userSession/userSession'; +import { purgeMessages } from '@plone/volto/actions/messages/messages'; import { toast } from 'react-toastify'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx b/packages/volto/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx index 6e71beb381..33b360e9f4 100644 --- a/packages/volto/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +++ b/packages/volto/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx @@ -3,8 +3,8 @@ import { Redirect } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import { useCookies } from 'react-cookie'; import config from '@plone/volto/registry'; -import { changeLanguage } from '@plone/volto/actions'; -import { toGettextLang } from '@plone/volto/helpers'; +import { changeLanguage } from '@plone/volto/actions/language/language'; +import { toGettextLang } from '@plone/volto/helpers/Utils/Utils'; const MultilingualRedirector = (props) => { const { settings } = config; diff --git a/packages/volto/src/components/theme/Navigation/ContextNavigation.jsx b/packages/volto/src/components/theme/Navigation/ContextNavigation.jsx index f255bb7212..2800ad8b3c 100644 --- a/packages/volto/src/components/theme/Navigation/ContextNavigation.jsx +++ b/packages/volto/src/components/theme/Navigation/ContextNavigation.jsx @@ -7,8 +7,9 @@ import { compose } from 'redux'; import { withRouter } from 'react-router'; import { defineMessages, useIntl } from 'react-intl'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { Icon, UniversalLink } from '@plone/volto/components'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { withContentNavigation } from './withContentNavigation'; import leftIcon from '@plone/volto/icons/left-key.svg'; diff --git a/packages/volto/src/components/theme/Navigation/NavItem.jsx b/packages/volto/src/components/theme/Navigation/NavItem.jsx index db4f9e5585..6e3947ddf4 100644 --- a/packages/volto/src/components/theme/Navigation/NavItem.jsx +++ b/packages/volto/src/components/theme/Navigation/NavItem.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { NavLink } from 'react-router-dom'; -import { isInternalURL, toBackendLang } from '@plone/volto/helpers'; +import { isInternalURL } from '@plone/volto/helpers/Url/Url'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; const NavItem = ({ item, lang }) => { diff --git a/packages/volto/src/components/theme/Navigation/Navigation.jsx b/packages/volto/src/components/theme/Navigation/Navigation.jsx index 56cc0a6d19..b5e67f70a9 100644 --- a/packages/volto/src/components/theme/Navigation/Navigation.jsx +++ b/packages/volto/src/components/theme/Navigation/Navigation.jsx @@ -5,9 +5,11 @@ import { defineMessages, useIntl } from 'react-intl'; import { Menu } from 'semantic-ui-react'; import cx from 'classnames'; -import { BodyClass, getBaseUrl, hasApiExpander } from '@plone/volto/helpers'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; -import { getNavigation } from '@plone/volto/actions'; +import { getNavigation } from '@plone/volto/actions/navigation/navigation'; import { CSSTransition } from 'react-transition-group'; import NavItems from '@plone/volto/components/theme/Navigation/NavItems'; diff --git a/packages/volto/src/components/theme/Navigation/withContentNavigation.js b/packages/volto/src/components/theme/Navigation/withContentNavigation.js index c7e7cf19d7..672717f879 100644 --- a/packages/volto/src/components/theme/Navigation/withContentNavigation.js +++ b/packages/volto/src/components/theme/Navigation/withContentNavigation.js @@ -3,8 +3,8 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import useDeepCompareEffect from 'use-deep-compare-effect'; -import { getBaseUrl } from '@plone/volto/helpers'; -import { getContextNavigation } from '@plone/volto/actions'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { getContextNavigation } from '@plone/volto/actions/contextNavigation/contextNavigation'; export function withContentNavigation(WrappedComponent) { /** diff --git a/packages/volto/src/components/theme/NotFound/NotFound.jsx b/packages/volto/src/components/theme/NotFound/NotFound.jsx index d0a90723a2..189f967477 100644 --- a/packages/volto/src/components/theme/NotFound/NotFound.jsx +++ b/packages/volto/src/components/theme/NotFound/NotFound.jsx @@ -1,11 +1,14 @@ import { useEffect } from 'react'; -import { BodyClass, toBackendLang } from '@plone/volto/helpers'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { Container } from 'semantic-ui-react'; -import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils'; +import { + toBackendLang, + withServerErrorCode, +} from '@plone/volto/helpers/Utils/Utils'; import { useDispatch, useSelector } from 'react-redux'; -import { getNavigation } from '@plone/volto/actions'; +import { getNavigation } from '@plone/volto/actions/navigation/navigation'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/components/theme/Pagination/Pagination.jsx b/packages/volto/src/components/theme/Pagination/Pagination.jsx index 77ae8160ea..8f492bf8ee 100644 --- a/packages/volto/src/components/theme/Pagination/Pagination.jsx +++ b/packages/volto/src/components/theme/Pagination/Pagination.jsx @@ -5,9 +5,9 @@ import React from 'react'; import { Menu } from 'semantic-ui-react'; -import { Icon } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import PropTypes from 'prop-types'; -import { map } from 'lodash'; +import map from 'lodash/map'; import { FormattedMessage, injectIntl } from 'react-intl'; import leftChevron from '@plone/volto/icons/left-key.svg'; import rightChevron from '@plone/volto/icons/right-key.svg'; diff --git a/packages/volto/src/components/theme/PasswordReset/PasswordReset.jsx b/packages/volto/src/components/theme/PasswordReset/PasswordReset.jsx index 51c70f505d..4280c358ac 100644 --- a/packages/volto/src/components/theme/PasswordReset/PasswordReset.jsx +++ b/packages/volto/src/components/theme/PasswordReset/PasswordReset.jsx @@ -8,12 +8,12 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link, withRouter } from 'react-router-dom'; -import { Helmet } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { Container } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Form } from '@plone/volto/components/manage/Form'; -import { setInitialPassword } from '@plone/volto/actions'; +import { setInitialPassword } from '@plone/volto/actions/users/users'; import config from '@plone/volto/registry'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/PasswordReset/RequestPasswordReset.jsx b/packages/volto/src/components/theme/PasswordReset/RequestPasswordReset.jsx index d7cbd87ef1..ba15a33ff8 100644 --- a/packages/volto/src/components/theme/PasswordReset/RequestPasswordReset.jsx +++ b/packages/volto/src/components/theme/PasswordReset/RequestPasswordReset.jsx @@ -4,9 +4,10 @@ import { useHistory } from 'react-router-dom'; import { Container } from 'semantic-ui-react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; -import { Helmet, usePrevious } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; import { Form } from '@plone/volto/components/manage/Form'; -import { resetPassword } from '@plone/volto/actions'; +import { resetPassword } from '@plone/volto/actions/users/users'; import config from '@plone/volto/registry'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/Register/Register.jsx b/packages/volto/src/components/theme/Register/Register.jsx index e8fc522e7d..52c1430a9e 100644 --- a/packages/volto/src/components/theme/Register/Register.jsx +++ b/packages/volto/src/components/theme/Register/Register.jsx @@ -4,10 +4,11 @@ import { defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; import { toast } from 'react-toastify'; -import { Helmet, usePrevious } from '@plone/volto/helpers'; -import { Toast } from '@plone/volto/components'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious'; +import Toast from '@plone/volto/components/manage/Toast/Toast'; import { Form } from '@plone/volto/components/manage/Form'; -import { createUser } from '@plone/volto/actions'; +import { createUser } from '@plone/volto/actions/users/users'; const messages = defineMessages({ title: { diff --git a/packages/volto/src/components/theme/Search/Search.jsx b/packages/volto/src/components/theme/Search/Search.jsx index af5c0a30c5..b3c6ce9d22 100644 --- a/packages/volto/src/components/theme/Search/Search.jsx +++ b/packages/volto/src/components/theme/Search/Search.jsx @@ -7,8 +7,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { UniversalLink } from '@plone/volto/components'; -import { asyncConnect } from '@plone/volto/helpers'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; import { FormattedMessage } from 'react-intl'; import { createPortal } from 'react-dom'; import { Container, Pagination, Button, Header } from 'semantic-ui-react'; @@ -16,9 +16,11 @@ import qs from 'query-string'; import classNames from 'classnames'; import { defineMessages, injectIntl } from 'react-intl'; import config from '@plone/volto/registry'; -import { Helmet } from '@plone/volto/helpers'; -import { searchContent } from '@plone/volto/actions'; -import { SearchTags, Toolbar, Icon } from '@plone/volto/components'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { searchContent } from '@plone/volto/actions/search/search'; +import SearchTags from '@plone/volto/components/theme/Search/SearchTags'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import paginationLeftSVG from '@plone/volto/icons/left-key.svg'; import paginationRightSVG from '@plone/volto/icons/right-key.svg'; diff --git a/packages/volto/src/components/theme/Search/SearchTags.jsx b/packages/volto/src/components/theme/Search/SearchTags.jsx index af434a5d32..1ea468cf4a 100644 --- a/packages/volto/src/components/theme/Search/SearchTags.jsx +++ b/packages/volto/src/components/theme/Search/SearchTags.jsx @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import { Link } from 'react-router-dom'; -import { getVocabulary } from '@plone/volto/actions'; +import { getVocabulary } from '@plone/volto/actions/vocabularies/vocabularies'; const vocabulary = 'plone.app.vocabularies.Keywords'; diff --git a/packages/volto/src/components/theme/SearchWidget/SearchWidget.jsx b/packages/volto/src/components/theme/SearchWidget/SearchWidget.jsx index 89db2a9a38..ace78a599e 100644 --- a/packages/volto/src/components/theme/SearchWidget/SearchWidget.jsx +++ b/packages/volto/src/components/theme/SearchWidget/SearchWidget.jsx @@ -4,9 +4,10 @@ import { Form, Input } from 'semantic-ui-react'; import { defineMessages, useIntl } from 'react-intl'; import { useDispatch, useSelector } from 'react-redux'; -import { getNavroot } from '@plone/volto/actions'; -import { hasApiExpander, getBaseUrl } from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; +import { getNavroot } from '@plone/volto/actions/navroot/navroot'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; import zoomSVG from '@plone/volto/icons/zoom.svg'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/Sitemap/Sitemap.jsx b/packages/volto/src/components/theme/Sitemap/Sitemap.jsx index 021deffc18..99cbfd6b79 100644 --- a/packages/volto/src/components/theme/Sitemap/Sitemap.jsx +++ b/packages/volto/src/components/theme/Sitemap/Sitemap.jsx @@ -2,14 +2,15 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { compose } from 'redux'; import { connect } from 'react-redux'; -import { asyncConnect } from '@plone/volto/helpers'; +import { asyncConnect } from '@plone/volto/helpers/AsyncConnect'; import { defineMessages, injectIntl } from 'react-intl'; import { Container as SemanticContainer } from 'semantic-ui-react'; -import { Helmet, toBackendLang } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { Link } from 'react-router-dom'; import config from '@plone/volto/registry'; -import { getNavigation } from '@plone/volto/actions'; +import { getNavigation } from '@plone/volto/actions/navigation/navigation'; const messages = defineMessages({ Sitemap: { diff --git a/packages/volto/src/components/theme/Unauthorized/Unauthorized.jsx b/packages/volto/src/components/theme/Unauthorized/Unauthorized.jsx index 9e87285312..a46d795a1b 100644 --- a/packages/volto/src/components/theme/Unauthorized/Unauthorized.jsx +++ b/packages/volto/src/components/theme/Unauthorized/Unauthorized.jsx @@ -4,7 +4,7 @@ import { Container } from 'semantic-ui-react'; import { useSelector } from 'react-redux'; import { useLocation } from 'react-router-dom'; import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils'; -import { getBaseUrl } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; const Unauthorized = () => { const error_message = useSelector((state) => state.apierror?.message); diff --git a/packages/volto/src/components/theme/View/AlbumView.jsx b/packages/volto/src/components/theme/View/AlbumView.jsx index 55171c6c46..ace13e4a0e 100644 --- a/packages/volto/src/components/theme/View/AlbumView.jsx +++ b/packages/volto/src/components/theme/View/AlbumView.jsx @@ -6,7 +6,8 @@ import { Segment, } from 'semantic-ui-react'; import { Button, Modal, Grid } from 'semantic-ui-react'; -import { Icon, UniversalLink } from '@plone/volto/components'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import config from '@plone/volto/registry'; import openSVG from '@plone/volto/icons/open.svg'; diff --git a/packages/volto/src/components/theme/View/DefaultView.jsx b/packages/volto/src/components/theme/View/DefaultView.jsx index 770dbd6e1a..2bed8470e6 100644 --- a/packages/volto/src/components/theme/View/DefaultView.jsx +++ b/packages/volto/src/components/theme/View/DefaultView.jsx @@ -13,14 +13,15 @@ import { Label, } from 'semantic-ui-react'; import config from '@plone/volto/registry'; -import { getSchema } from '@plone/volto/actions'; +import { getSchema } from '@plone/volto/actions/schema/schema'; import { getWidget } from '@plone/volto/helpers/Widget/utils'; import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; -import { hasBlocksData, getBaseUrl } from '@plone/volto/helpers'; +import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import { useDispatch, useSelector } from 'react-redux'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; /** * Component to display the default view. diff --git a/packages/volto/src/components/theme/View/EventDatesInfo.jsx b/packages/volto/src/components/theme/View/EventDatesInfo.jsx index 60a4c607c6..232df550f6 100644 --- a/packages/volto/src/components/theme/View/EventDatesInfo.jsx +++ b/packages/volto/src/components/theme/View/EventDatesInfo.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { List } from 'semantic-ui-react'; import cx from 'classnames'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import { useSelector } from 'react-redux'; diff --git a/packages/volto/src/components/theme/View/EventView.jsx b/packages/volto/src/components/theme/View/EventView.jsx index 425d7055b7..28dc899025 100644 --- a/packages/volto/src/components/theme/View/EventView.jsx +++ b/packages/volto/src/components/theme/View/EventView.jsx @@ -5,10 +5,11 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { hasBlocksData, flattenHTMLToAppURL } from '@plone/volto/helpers'; +import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks'; +import { flattenHTMLToAppURL } from '@plone/volto/helpers/Url/Url'; import { Grid } from 'semantic-ui-react'; import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; -import { EventDetails } from '@plone/volto/components'; +import EventDetails from '@plone/volto/components/theme/EventDetails/EventDetails'; import { Container as SemanticContainer } from 'semantic-ui-react'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/View/FileView.jsx b/packages/volto/src/components/theme/View/FileView.jsx index 2c534e2050..22f9b9e25d 100644 --- a/packages/volto/src/components/theme/View/FileView.jsx +++ b/packages/volto/src/components/theme/View/FileView.jsx @@ -6,7 +6,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Container as SemanticContainer } from 'semantic-ui-react'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/components/theme/View/ImageView.jsx b/packages/volto/src/components/theme/View/ImageView.jsx index 9e6f8020fc..2144b359d8 100644 --- a/packages/volto/src/components/theme/View/ImageView.jsx +++ b/packages/volto/src/components/theme/View/ImageView.jsx @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import { Container as SemanticContainer } from 'semantic-ui-react'; import { FormattedMessage } from 'react-intl'; import prettybytes from 'pretty-bytes'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/components/theme/View/LinkView.jsx b/packages/volto/src/components/theme/View/LinkView.jsx index e2f8538612..ad766f5b7e 100644 --- a/packages/volto/src/components/theme/View/LinkView.jsx +++ b/packages/volto/src/components/theme/View/LinkView.jsx @@ -1,9 +1,9 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; import { useHistory } from 'react-router-dom'; -import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers'; +import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { Container as SemanticContainer } from 'semantic-ui-react'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { Redirect } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/View/ListingView.jsx b/packages/volto/src/components/theme/View/ListingView.jsx index df676ef35e..9c6bf30f9b 100644 --- a/packages/volto/src/components/theme/View/ListingView.jsx +++ b/packages/volto/src/components/theme/View/ListingView.jsx @@ -6,7 +6,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Segment, Container as SemanticContainer } from 'semantic-ui-react'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/components/theme/View/NewsItemView.jsx b/packages/volto/src/components/theme/View/NewsItemView.jsx index 18d3554edc..99586cdc94 100644 --- a/packages/volto/src/components/theme/View/NewsItemView.jsx +++ b/packages/volto/src/components/theme/View/NewsItemView.jsx @@ -6,7 +6,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Container as SemanticContainer } from 'semantic-ui-react'; -import { hasBlocksData, flattenHTMLToAppURL } from '@plone/volto/helpers'; +import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks'; +import { flattenHTMLToAppURL } from '@plone/volto/helpers/Url/Url'; import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/View/RenderBlocks.jsx b/packages/volto/src/components/theme/View/RenderBlocks.jsx index 439bfb0dc9..91ef47310b 100644 --- a/packages/volto/src/components/theme/View/RenderBlocks.jsx +++ b/packages/volto/src/components/theme/View/RenderBlocks.jsx @@ -1,16 +1,17 @@ import React from 'react'; -import { getBaseUrl, applyBlockDefaults } from '@plone/volto/helpers'; +import { getBaseUrl } from '@plone/volto/helpers/Url/Url'; import { defineMessages, useIntl } from 'react-intl'; -import { map } from 'lodash'; -import { MaybeWrap } from '@plone/volto/components'; +import map from 'lodash/map'; +import MaybeWrap from '@plone/volto/components/manage/MaybeWrap/MaybeWrap'; import { + applyBlockDefaults, getBlocksFieldname, getBlocksLayoutFieldname, hasBlocksData, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Blocks/Blocks'; import StyleWrapper from '@plone/volto/components/manage/Blocks/Block/StyleWrapper'; import config from '@plone/volto/registry'; -import { ViewDefaultBlock } from '@plone/volto/components'; +import ViewDefaultBlock from '@plone/volto/components/manage/Blocks/Block/DefaultView'; import RenderEmptyBlock from './RenderEmptyBlock'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/View/SummaryView.jsx b/packages/volto/src/components/theme/View/SummaryView.jsx index 5a4d014e82..792066955b 100644 --- a/packages/volto/src/components/theme/View/SummaryView.jsx +++ b/packages/volto/src/components/theme/View/SummaryView.jsx @@ -5,7 +5,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { Container as SemanticContainer } from 'semantic-ui-react'; import { FormattedMessage } from 'react-intl'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/View/TabularView.jsx b/packages/volto/src/components/theme/View/TabularView.jsx index 8fe47e9b00..cc15acfa25 100644 --- a/packages/volto/src/components/theme/View/TabularView.jsx +++ b/packages/volto/src/components/theme/View/TabularView.jsx @@ -5,7 +5,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; import { Container as SemanticContainer, Table } from 'semantic-ui-react'; import { FormattedMessage } from 'react-intl'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/components/theme/View/View.jsx b/packages/volto/src/components/theme/View/View.jsx index 6f4ff0f5e7..902204c869 100644 --- a/packages/volto/src/components/theme/View/View.jsx +++ b/packages/volto/src/components/theme/View/View.jsx @@ -12,19 +12,15 @@ import { createPortal } from 'react-dom'; import { injectIntl } from 'react-intl'; import qs from 'query-string'; -import { - ContentMetadataTags, - Comments, - Toolbar, -} from '@plone/volto/components'; -import { listActions, getContent } from '@plone/volto/actions'; -import { - BodyClass, - getBaseUrl, - flattenToAppURL, - getLayoutFieldname, - hasApiExpander, -} from '@plone/volto/helpers'; +import ContentMetadataTags from '@plone/volto/components/theme/ContentMetadataTags/ContentMetadataTags'; +import Comments from '@plone/volto/components/theme/Comments/Comments'; +import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar'; +import { listActions } from '@plone/volto/actions/actions/actions'; +import { getContent } from '@plone/volto/actions/content/content'; +import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; +import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { getLayoutFieldname } from '@plone/volto/helpers/Content/Content'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; import SlotRenderer from '../SlotRenderer/SlotRenderer'; diff --git a/packages/volto/src/components/theme/Widgets/BooleanWidget.jsx b/packages/volto/src/components/theme/Widgets/BooleanWidget.jsx index 6abb15db0c..76e99a5e4d 100644 --- a/packages/volto/src/components/theme/Widgets/BooleanWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/BooleanWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import cx from 'classnames'; -import { isBoolean } from 'lodash'; +import isBoolean from 'lodash/isBoolean'; import { defineMessages, injectIntl } from 'react-intl'; const messages = defineMessages({ diff --git a/packages/volto/src/components/theme/Widgets/DateWidget.jsx b/packages/volto/src/components/theme/Widgets/DateWidget.jsx index 796d402efe..4eddc12bce 100644 --- a/packages/volto/src/components/theme/Widgets/DateWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/DateWidget.jsx @@ -2,7 +2,7 @@ import React from 'react'; import cx from 'classnames'; import moment from 'moment'; import { useSelector } from 'react-redux'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; const DateWidget = ({ value, children, className, format = 'll' }) => { const lang = useSelector((state) => state.intl.locale); diff --git a/packages/volto/src/components/theme/Widgets/DatetimeWidget.jsx b/packages/volto/src/components/theme/Widgets/DatetimeWidget.jsx index 5516102cf3..5904da4b73 100644 --- a/packages/volto/src/components/theme/Widgets/DatetimeWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/DatetimeWidget.jsx @@ -2,7 +2,7 @@ import React from 'react'; import cx from 'classnames'; import moment from 'moment'; import { useSelector } from 'react-redux'; -import { toBackendLang } from '@plone/volto/helpers'; +import { toBackendLang } from '@plone/volto/helpers/Utils/Utils'; const DatetimeWidget = ({ value, children, className, format = 'lll' }) => { const lang = useSelector((state) => state.intl.locale); diff --git a/packages/volto/src/components/theme/Widgets/EmailWidget.jsx b/packages/volto/src/components/theme/Widgets/EmailWidget.jsx index d37712cac9..bdc0fa7fcc 100644 --- a/packages/volto/src/components/theme/Widgets/EmailWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/EmailWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import cx from 'classnames'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const EmailWidget = ({ value, children, className }) => value ? ( diff --git a/packages/volto/src/components/theme/Widgets/FileWidget.jsx b/packages/volto/src/components/theme/Widgets/FileWidget.jsx index b1ed4dfc8e..f7cd9ff07d 100644 --- a/packages/volto/src/components/theme/Widgets/FileWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/FileWidget.jsx @@ -1,7 +1,7 @@ import React from 'react'; import cx from 'classnames'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { UniversalLink } from '@plone/volto/components'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const niceBytes = (bytes) => { bytes = Number(bytes); diff --git a/packages/volto/src/components/theme/Widgets/ImageWidget.jsx b/packages/volto/src/components/theme/Widgets/ImageWidget.jsx index 53369bb8d1..922f057454 100644 --- a/packages/volto/src/components/theme/Widgets/ImageWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/ImageWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import cx from 'classnames'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; const niceBytes = (bytes) => { bytes = Number(bytes); diff --git a/packages/volto/src/components/theme/Widgets/RelationWidget.jsx b/packages/volto/src/components/theme/Widgets/RelationWidget.jsx index b3acb11bdf..2ea6ec67cc 100644 --- a/packages/volto/src/components/theme/Widgets/RelationWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/RelationWidget.jsx @@ -1,9 +1,9 @@ import React from 'react'; import cx from 'classnames'; -import { flattenToAppURL } from '@plone/volto/helpers'; -import { getContentIcon } from '@plone/volto/helpers'; -import { Icon } from '@plone/volto/components'; -import { UniversalLink } from '@plone/volto/components'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import { getContentIcon } from '@plone/volto/helpers/Content/Content'; +import Icon from '@plone/volto/components/theme/Icon/Icon'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const RelationWidget = ({ value, children, className }) => { if (!value) { diff --git a/packages/volto/src/components/theme/Widgets/TokenWidget.jsx b/packages/volto/src/components/theme/Widgets/TokenWidget.jsx index 4ff17bc312..a80f8f42f0 100644 --- a/packages/volto/src/components/theme/Widgets/TokenWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/TokenWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import cx from 'classnames'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const TokenWidget = ({ value, children, className }) => value ? ( diff --git a/packages/volto/src/components/theme/Widgets/UrlWidget.jsx b/packages/volto/src/components/theme/Widgets/UrlWidget.jsx index 8c81a4bcd6..652697ee27 100644 --- a/packages/volto/src/components/theme/Widgets/UrlWidget.jsx +++ b/packages/volto/src/components/theme/Widgets/UrlWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import cx from 'classnames'; -import { UniversalLink } from '@plone/volto/components'; +import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink'; const UrlWidget = ({ value, children, className }) => value ? ( diff --git a/packages/volto/src/config/Blocks.jsx b/packages/volto/src/config/Blocks.jsx index 9da497cdb0..573bdce903 100644 --- a/packages/volto/src/config/Blocks.jsx +++ b/packages/volto/src/config/Blocks.jsx @@ -1,5 +1,5 @@ import { defineMessages } from 'react-intl'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import ViewTitleBlock from '@plone/volto/components/manage/Blocks/Title/View'; import ViewDescriptionBlock from '@plone/volto/components/manage/Blocks/Description/View'; diff --git a/packages/volto/src/config/Components.jsx b/packages/volto/src/config/Components.jsx index 059a3f1f42..bd6fea6f85 100644 --- a/packages/volto/src/config/Components.jsx +++ b/packages/volto/src/config/Components.jsx @@ -1,4 +1,6 @@ -import { App, PreviewImage, Image } from '@plone/volto/components'; +import App from '@plone/volto/components/theme/App/App'; +import PreviewImage from '@plone/volto/components/theme/PreviewImage/PreviewImage'; +import Image from '@plone/volto/components/theme/Image/Image'; // Register components. export const components = { diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index 803048b14d..348b21319d 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -34,7 +34,7 @@ import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons'; import ConfigRegistry from '@plone/volto/registry'; -import { getSiteAsyncPropExtender } from '@plone/volto/helpers'; +import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site'; import { registerValidators } from './validation'; const host = process.env.HOST || 'localhost'; diff --git a/packages/volto/src/config/slots.js b/packages/volto/src/config/slots.js index 3e2411c08d..008bada7e2 100644 --- a/packages/volto/src/config/slots.js +++ b/packages/volto/src/config/slots.js @@ -1,4 +1,4 @@ -import { Tags } from '@plone/volto/components'; +import Tags from '@plone/volto/components/theme/Tags/Tags'; const slots = { belowContent: [ diff --git a/packages/volto/src/express-middleware/files.js b/packages/volto/src/express-middleware/files.js index f13708a504..40f3f5d71a 100644 --- a/packages/volto/src/express-middleware/files.js +++ b/packages/volto/src/express-middleware/files.js @@ -1,5 +1,5 @@ import express from 'express'; -import { getAPIResourceWithAuth } from '@plone/volto/helpers'; +import { getAPIResourceWithAuth } from '@plone/volto/helpers/Api/APIResourceWithAuth'; const HEADERS = [ 'accept-ranges', diff --git a/packages/volto/src/express-middleware/images.js b/packages/volto/src/express-middleware/images.js index 85ab829341..666e57e909 100644 --- a/packages/volto/src/express-middleware/images.js +++ b/packages/volto/src/express-middleware/images.js @@ -1,5 +1,5 @@ import express from 'express'; -import { getAPIResourceWithAuth } from '@plone/volto/helpers'; +import { getAPIResourceWithAuth } from '@plone/volto/helpers/Api/APIResourceWithAuth'; const HEADERS = [ 'content-type', diff --git a/packages/volto/src/express-middleware/robotstxt.js b/packages/volto/src/express-middleware/robotstxt.js index 4a68ed7001..b0fb708507 100644 --- a/packages/volto/src/express-middleware/robotstxt.js +++ b/packages/volto/src/express-middleware/robotstxt.js @@ -1,5 +1,5 @@ import express from 'express'; -import { generateRobots } from '@plone/volto/helpers'; +import { generateRobots } from '@plone/volto/helpers/Robots/Robots'; /* robots.txt - priority order: diff --git a/packages/volto/src/helpers/Api/Api.js b/packages/volto/src/helpers/Api/Api.js index da26329b1c..b92fd896c1 100644 --- a/packages/volto/src/helpers/Api/Api.js +++ b/packages/volto/src/helpers/Api/Api.js @@ -7,7 +7,7 @@ import superagent from 'superagent'; import Cookies from 'universal-cookie'; import config from '@plone/volto/registry'; import { addHeadersFactory } from '@plone/volto/helpers/Proxy/Proxy'; -import { stripQuerystring } from '@plone/volto/helpers'; +import { stripQuerystring } from '@plone/volto/helpers/Url/Url'; const methods = ['get', 'post', 'put', 'patch', 'del']; diff --git a/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js b/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js index fcf54dfa7c..1b2036e229 100644 --- a/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js +++ b/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js @@ -5,7 +5,10 @@ import { renderRoutes } from 'react-router-config'; import { createStore, combineReducers } from 'redux'; import { render } from '@testing-library/react'; -import { endGlobalLoad, beginGlobalLoad } from '@plone/volto/actions'; +import { + endGlobalLoad, + beginGlobalLoad, +} from '@plone/volto/actions/asyncConnect/asyncConnect'; import reduxAsyncConnect from '@plone/volto/reducers/asyncConnect/asyncConnect'; import { AsyncConnectWithContext, AsyncConnect } from './AsyncConnect'; // , AsyncConnect diff --git a/packages/volto/src/helpers/AuthToken/AuthToken.js b/packages/volto/src/helpers/AuthToken/AuthToken.js index 9a1a1038ee..cbd480b790 100644 --- a/packages/volto/src/helpers/AuthToken/AuthToken.js +++ b/packages/volto/src/helpers/AuthToken/AuthToken.js @@ -6,8 +6,8 @@ import Cookies from 'universal-cookie'; import jwtDecode from 'jwt-decode'; -import { loginRenew } from '@plone/volto/actions'; -import { getCookieOptions } from '@plone/volto/helpers'; +import { loginRenew } from '@plone/volto/actions/userSession/userSession'; +import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; import { push } from 'connected-react-router'; /** diff --git a/packages/volto/src/helpers/Blocks/Blocks.js b/packages/volto/src/helpers/Blocks/Blocks.js index e863bfc231..d5559828e5 100644 --- a/packages/volto/src/helpers/Blocks/Blocks.js +++ b/packages/volto/src/helpers/Blocks/Blocks.js @@ -3,15 +3,21 @@ * @module helpers/Blocks */ -import { omit, without, endsWith, find, isObject, keys, merge } from 'lodash'; +import omit from 'lodash/omit'; +import without from 'lodash/without'; +import endsWith from 'lodash/endsWith'; +import find from 'lodash/find'; +import isObject from 'lodash/isObject'; +import keys from 'lodash/keys'; +import merge from 'lodash/merge'; import move from 'lodash-move'; import { v4 as uuid } from 'uuid'; import config from '@plone/volto/registry'; +import { applySchemaEnhancer } from '@plone/volto/helpers/Extensions'; import { - applySchemaEnhancer, insertInArray, removeFromArray, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Utils/Utils'; /** * Get blocks field. diff --git a/packages/volto/src/helpers/Blocks/cloneBlocks.test.js b/packages/volto/src/helpers/Blocks/cloneBlocks.test.js index b50832f8de..103fee473a 100644 --- a/packages/volto/src/helpers/Blocks/cloneBlocks.test.js +++ b/packages/volto/src/helpers/Blocks/cloneBlocks.test.js @@ -1,4 +1,4 @@ -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import { cloneBlocks } from './cloneBlocks'; describe('cloneBlocks', () => { diff --git a/packages/volto/src/helpers/Content/Content.js b/packages/volto/src/helpers/Content/Content.js index 84591b2f4a..b9a8ab509d 100644 --- a/packages/volto/src/helpers/Content/Content.js +++ b/packages/volto/src/helpers/Content/Content.js @@ -3,7 +3,13 @@ * @module helpers/Content */ -import { omitBy, mapKeys, pickBy, map, keys, endsWith, find } from 'lodash'; +import omitBy from 'lodash/omitBy'; +import mapKeys from 'lodash/mapKeys'; +import pickBy from 'lodash/pickBy'; +import map from 'lodash/map'; +import keys from 'lodash/keys'; +import endsWith from 'lodash/endsWith'; +import find from 'lodash/find'; import config from '@plone/volto/registry'; /** diff --git a/packages/volto/src/helpers/Extensions/withBlockSchemaEnhancer.jsx b/packages/volto/src/helpers/Extensions/withBlockSchemaEnhancer.jsx index 5db6d15539..126c8772e5 100644 --- a/packages/volto/src/helpers/Extensions/withBlockSchemaEnhancer.jsx +++ b/packages/volto/src/helpers/Extensions/withBlockSchemaEnhancer.jsx @@ -1,7 +1,8 @@ import React from 'react'; import { defineMessages } from 'react-intl'; import { useIntl } from 'react-intl'; -import { find, isEmpty } from 'lodash'; +import find from 'lodash/find'; +import isEmpty from 'lodash/isEmpty'; import config from '@plone/volto/registry'; import { cloneDeepSchema } from '@plone/volto/helpers/Utils/Utils'; diff --git a/packages/volto/src/helpers/FormValidation/FormValidation.jsx b/packages/volto/src/helpers/FormValidation/FormValidation.jsx index 92dcdd7cee..387d1544dc 100644 --- a/packages/volto/src/helpers/FormValidation/FormValidation.jsx +++ b/packages/volto/src/helpers/FormValidation/FormValidation.jsx @@ -1,4 +1,7 @@ -import { map, keys, intersection, isEmpty } from 'lodash'; +import map from 'lodash/map'; +import keys from 'lodash/keys'; +import intersection from 'lodash/intersection'; +import isEmpty from 'lodash/isEmpty'; import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels'; import config from '@plone/volto/registry'; import { toast } from 'react-toastify'; diff --git a/packages/volto/src/helpers/Html/Html.jsx b/packages/volto/src/helpers/Html/Html.jsx index 4a9ae607f5..90237ca65f 100644 --- a/packages/volto/src/helpers/Html/Html.jsx +++ b/packages/volto/src/helpers/Html/Html.jsx @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import serialize from 'serialize-javascript'; -import { join } from 'lodash'; +import join from 'lodash/join'; import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; import { runtimeConfig } from '@plone/volto/runtime_config'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/helpers/Loadable/Loadable.jsx b/packages/volto/src/helpers/Loadable/Loadable.jsx index ce9f142d27..2d1c45d6e3 100644 --- a/packages/volto/src/helpers/Loadable/Loadable.jsx +++ b/packages/volto/src/helpers/Loadable/Loadable.jsx @@ -1,9 +1,9 @@ import React from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { useDispatch, useSelector, shallowEqual } from 'react-redux'; -import { omit } from 'lodash'; +import omit from 'lodash/omit'; -import { loadLazyLibrary } from '@plone/volto/actions'; +import { loadLazyLibrary } from '@plone/volto/actions/lazyLibraries/lazyLibraries'; import config from '@plone/volto/registry'; const validateLibs = (maybeLibs) => { diff --git a/packages/volto/src/helpers/Site/index.js b/packages/volto/src/helpers/Site/index.js index 9cc76ab746..18c4b0a263 100644 --- a/packages/volto/src/helpers/Site/index.js +++ b/packages/volto/src/helpers/Site/index.js @@ -1,5 +1,5 @@ import { GET_SITE } from '@plone/volto/constants/ActionTypes'; -import { getSite } from '@plone/volto/actions'; +import { getSite } from '@plone/volto/actions/site/site'; const getSiteAsyncPropExtender = { path: '/', diff --git a/packages/volto/src/helpers/Sitemap/Sitemap.js b/packages/volto/src/helpers/Sitemap/Sitemap.js index 64cc8dadb2..0562cfa5f2 100644 --- a/packages/volto/src/helpers/Sitemap/Sitemap.js +++ b/packages/volto/src/helpers/Sitemap/Sitemap.js @@ -4,9 +4,9 @@ */ import superagent from 'superagent'; -import { map } from 'lodash'; +import map from 'lodash/map'; import zlib from 'zlib'; -import { toPublicURL } from '@plone/volto/helpers'; +import { toPublicURL } from '@plone/volto/helpers/Url/Url'; import { addHeadersFactory } from '@plone/volto/helpers/Proxy/Proxy'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/helpers/Url/Url.js b/packages/volto/src/helpers/Url/Url.js index 889d2c04a2..f18595a373 100644 --- a/packages/volto/src/helpers/Url/Url.js +++ b/packages/volto/src/helpers/Url/Url.js @@ -3,7 +3,11 @@ * @module helpers/Url */ -import { last, memoize, isArray, isObject, isString } from 'lodash'; +import last from 'lodash/last'; +import memoize from 'lodash/memoize'; +import isArray from 'lodash/isArray'; +import isObject from 'lodash/isObject'; +import isString from 'lodash/isString'; import { urlRegex, telRegex, mailRegex } from './urlRegex'; import prependHttp from 'prepend-http'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/helpers/User/User.js b/packages/volto/src/helpers/User/User.js index 97392e996a..7717bf018f 100644 --- a/packages/volto/src/helpers/User/User.js +++ b/packages/volto/src/helpers/User/User.js @@ -2,7 +2,7 @@ * User helper. * @module helpers/AuthToken */ -import { intersection } from 'lodash'; +import intersection from 'lodash/intersection'; /** * Checks if the user has one or more given roles. diff --git a/packages/volto/src/helpers/Utils/UseDetectClickOutside.stories.jsx b/packages/volto/src/helpers/Utils/UseDetectClickOutside.stories.jsx index f8f69bf465..c665acd190 100644 --- a/packages/volto/src/helpers/Utils/UseDetectClickOutside.stories.jsx +++ b/packages/volto/src/helpers/Utils/UseDetectClickOutside.stories.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { useDetectClickOutside } from './useDetectClickOutside'; import { createPortal } from 'react-dom'; import { usePopper } from 'react-popper'; -import { BlockChooser } from '@plone/volto/components'; +import BlockChooser from '@plone/volto/components/manage/BlockChooser/BlockChooser'; function OpenedChooser(props) { const blockChooserRef = useDetectClickOutside({ diff --git a/packages/volto/src/helpers/Utils/Utils.jsx b/packages/volto/src/helpers/Utils/Utils.jsx index ce30acc8dd..b3de65844a 100644 --- a/packages/volto/src/helpers/Utils/Utils.jsx +++ b/packages/volto/src/helpers/Utils/Utils.jsx @@ -1,4 +1,8 @@ -import { cloneDeepWith, flatten, isEqual, isObject, transform } from 'lodash'; +import cloneDeepWith from 'lodash/cloneDeepWith'; +import flatten from 'lodash/flatten'; +import isEqual from 'lodash/isEqual'; +import isObject from 'lodash/isObject'; +import transform from 'lodash/transform'; import React from 'react'; import { matchPath } from 'react-router'; import config from '@plone/volto/registry'; diff --git a/packages/volto/src/helpers/Utils/useDetectClickOutside.js b/packages/volto/src/helpers/Utils/useDetectClickOutside.js index 59fa0a8fc7..1839710dc9 100644 --- a/packages/volto/src/helpers/Utils/useDetectClickOutside.js +++ b/packages/volto/src/helpers/Utils/useDetectClickOutside.js @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef } from 'react'; -import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib'; +import doesNodeContainClick from 'semantic-ui-react/dist/commonjs/lib/doesNodeContainClick'; /** * Hook used to detect clicks outside a component (or an escape key press). diff --git a/packages/volto/src/helpers/Utils/usePagination.js b/packages/volto/src/helpers/Utils/usePagination.js index 674b072bde..e50184a1e7 100644 --- a/packages/volto/src/helpers/Utils/usePagination.js +++ b/packages/volto/src/helpers/Utils/usePagination.js @@ -2,7 +2,8 @@ import React, { useRef, useEffect } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import qs from 'query-string'; import { useSelector } from 'react-redux'; -import { findBlocks, slugify } from '@plone/volto/helpers'; +import { findBlocks } from '@plone/volto/helpers/Blocks/Blocks'; +import { slugify } from '@plone/volto/helpers/Utils/Utils'; /** * @function useCreatePageQueryStringKey diff --git a/packages/volto/src/helpers/Workflows/Workflows.js b/packages/volto/src/helpers/Workflows/Workflows.js index 84fbe271fc..36d6635e23 100644 --- a/packages/volto/src/helpers/Workflows/Workflows.js +++ b/packages/volto/src/helpers/Workflows/Workflows.js @@ -4,7 +4,8 @@ */ import config from '@plone/volto/registry'; -import { last, split } from 'lodash'; +import last from 'lodash/last'; +import split from 'lodash/split'; /** * Maps the available transitions to the current list of colors and returns a diff --git a/packages/volto/src/hooks/user/useUser.js b/packages/volto/src/hooks/user/useUser.js index 3232ed0a8e..caf79f41f0 100644 --- a/packages/volto/src/hooks/user/useUser.js +++ b/packages/volto/src/hooks/user/useUser.js @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import jwtDecode from 'jwt-decode'; -import { getUser } from '@plone/volto/actions'; +import { getUser } from '@plone/volto/actions/users/users'; const useUser = () => { const users = useSelector((state) => state.users); diff --git a/packages/volto/src/middleware/api.js b/packages/volto/src/middleware/api.js index f0e0249287..ed93e28b31 100644 --- a/packages/volto/src/middleware/api.js +++ b/packages/volto/src/middleware/api.js @@ -5,7 +5,9 @@ import Cookies from 'universal-cookie'; import jwtDecode from 'jwt-decode'; -import { compact, flatten, union } from 'lodash'; +import compact from 'lodash/compact'; +import flatten from 'lodash/flatten'; +import union from 'lodash/union'; import { matchPath } from 'react-router'; import qs from 'query-string'; @@ -17,12 +19,13 @@ import { RESET_APIERROR, SET_APIERROR, } from '@plone/volto/constants/ActionTypes'; -import { changeLanguage, updateUploadedFiles } from '@plone/volto/actions'; +import { changeLanguage } from '@plone/volto/actions/language/language'; +import { updateUploadedFiles } from '@plone/volto/actions/content/content'; import { toGettextLang, toReactIntlLang, - getCookieOptions, -} from '@plone/volto/helpers'; +} from '@plone/volto/helpers/Utils/Utils'; +import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; let socket = null; /** diff --git a/packages/volto/src/middleware/storeProtectLoadUtils.js b/packages/volto/src/middleware/storeProtectLoadUtils.js index ed772abd0a..5075540ac6 100644 --- a/packages/volto/src/middleware/storeProtectLoadUtils.js +++ b/packages/volto/src/middleware/storeProtectLoadUtils.js @@ -1,4 +1,4 @@ -import { isCmsUi } from '@plone/volto/helpers'; +import { isCmsUi } from '@plone/volto/helpers/Url/Url'; const LOCATION_CHANGE = '@@router/LOCATION_CHANGE'; const PROTECT_START = '@@loadProtector/START'; diff --git a/packages/volto/src/reducers/actions/actions.js b/packages/volto/src/reducers/actions/actions.js index e3b544585f..9b3317ceab 100644 --- a/packages/volto/src/reducers/actions/actions.js +++ b/packages/volto/src/reducers/actions/actions.js @@ -4,11 +4,8 @@ */ import { GET_CONTENT, LIST_ACTIONS } from '@plone/volto/constants/ActionTypes'; -import { - flattenToAppURL, - getBaseUrl, - hasApiExpander, -} from '@plone/volto/helpers'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; const initialState = { error: null, diff --git a/packages/volto/src/reducers/breadcrumbs/breadcrumbs.js b/packages/volto/src/reducers/breadcrumbs/breadcrumbs.js index aab8c01405..dfee3f4f72 100644 --- a/packages/volto/src/reducers/breadcrumbs/breadcrumbs.js +++ b/packages/volto/src/reducers/breadcrumbs/breadcrumbs.js @@ -3,12 +3,9 @@ * @module reducers/breadcrumbs/breadcrumbs */ -import { map } from 'lodash'; -import { - flattenToAppURL, - getBaseUrl, - hasApiExpander, -} from '@plone/volto/helpers'; +import map from 'lodash/map'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import { GET_BREADCRUMBS, diff --git a/packages/volto/src/reducers/content/content.js b/packages/volto/src/reducers/content/content.js index 475498d7f6..46f5a5faea 100644 --- a/packages/volto/src/reducers/content/content.js +++ b/packages/volto/src/reducers/content/content.js @@ -3,9 +3,11 @@ * @module reducers/content/content */ -import { map, mapKeys, omit } from 'lodash'; +import map from 'lodash/map'; +import mapKeys from 'lodash/mapKeys'; +import omit from 'lodash/omit'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { CREATE_CONTENT, diff --git a/packages/volto/src/reducers/controlpanels/controlpanels.js b/packages/volto/src/reducers/controlpanels/controlpanels.js index 78b1e352bd..50406ff8c5 100644 --- a/packages/volto/src/reducers/controlpanels/controlpanels.js +++ b/packages/volto/src/reducers/controlpanels/controlpanels.js @@ -2,7 +2,7 @@ * Controlpanels reducer. * @module reducers/controlpanels/controlpanels */ -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { GET_CONTROLPANEL, POST_CONTROLPANEL, diff --git a/packages/volto/src/reducers/messages/messages.js b/packages/volto/src/reducers/messages/messages.js index 308d659c0d..932e1cc653 100644 --- a/packages/volto/src/reducers/messages/messages.js +++ b/packages/volto/src/reducers/messages/messages.js @@ -2,7 +2,9 @@ * Messages reducer. * @module reducers/messages/messages */ -import { map, concat, filter } from 'lodash'; +import map from 'lodash/map'; +import concat from 'lodash/concat'; +import filter from 'lodash/filter'; import { ADD_MESSAGE, diff --git a/packages/volto/src/reducers/navigation/navigation.js b/packages/volto/src/reducers/navigation/navigation.js index 2e00b551cc..51b774a77c 100644 --- a/packages/volto/src/reducers/navigation/navigation.js +++ b/packages/volto/src/reducers/navigation/navigation.js @@ -3,12 +3,9 @@ * @module reducers/navigation/navigation */ -import { map } from 'lodash'; -import { - flattenToAppURL, - getBaseUrl, - hasApiExpander, -} from '@plone/volto/helpers'; +import map from 'lodash/map'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import { GET_CONTENT, diff --git a/packages/volto/src/reducers/navroot/navroot.js b/packages/volto/src/reducers/navroot/navroot.js index 5da33328b5..431a581a01 100644 --- a/packages/volto/src/reducers/navroot/navroot.js +++ b/packages/volto/src/reducers/navroot/navroot.js @@ -2,11 +2,8 @@ * Navroot reducer. * @module reducers/navroot/navroot */ -import { - flattenToAppURL, - getBaseUrl, - hasApiExpander, -} from '@plone/volto/helpers'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; import { GET_NAVROOT, GET_CONTENT } from '@plone/volto/constants/ActionTypes'; diff --git a/packages/volto/src/reducers/querystringsearch/querystringsearch.js b/packages/volto/src/reducers/querystringsearch/querystringsearch.js index 3d8f740c4b..3e1e23cbae 100644 --- a/packages/volto/src/reducers/querystringsearch/querystringsearch.js +++ b/packages/volto/src/reducers/querystringsearch/querystringsearch.js @@ -1,5 +1,6 @@ -import { map, omit } from 'lodash'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import map from 'lodash/map'; +import omit from 'lodash/omit'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; const GET_QUERYSTRING_RESULTS = 'GET_QUERYSTRING_RESULTS'; const RESET_QUERYSTRING_RESULTS = 'RESET_QUERYSTRING_RESULTS'; diff --git a/packages/volto/src/reducers/schema/schema.js b/packages/volto/src/reducers/schema/schema.js index 18cfdd3a46..1244e6f76f 100644 --- a/packages/volto/src/reducers/schema/schema.js +++ b/packages/volto/src/reducers/schema/schema.js @@ -3,7 +3,13 @@ * @module reducers/schema/schema */ -import { flatten, keys, pickBy, isArray, map, mapKeys, merge } from 'lodash'; +import flatten from 'lodash/flatten'; +import keys from 'lodash/keys'; +import pickBy from 'lodash/pickBy'; +import isArray from 'lodash/isArray'; +import map from 'lodash/map'; +import mapKeys from 'lodash/mapKeys'; +import merge from 'lodash/merge'; import { GET_SCHEMA, diff --git a/packages/volto/src/reducers/search/search.js b/packages/volto/src/reducers/search/search.js index aa4249028d..b23423bc8e 100644 --- a/packages/volto/src/reducers/search/search.js +++ b/packages/volto/src/reducers/search/search.js @@ -3,8 +3,9 @@ * @module reducers/search/search */ -import { map, omit } from 'lodash'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import map from 'lodash/map'; +import omit from 'lodash/omit'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import { RESET_SEARCH_CONTENT, diff --git a/packages/volto/src/reducers/sidebar/sidebar.js b/packages/volto/src/reducers/sidebar/sidebar.js index fc2d9fd85c..791f1f9c1f 100644 --- a/packages/volto/src/reducers/sidebar/sidebar.js +++ b/packages/volto/src/reducers/sidebar/sidebar.js @@ -3,7 +3,7 @@ * @module reducers/sidebar/sidebar */ -import { union } from 'lodash'; +import union from 'lodash/union'; import { SET_METADATA_FIELDSETS, diff --git a/packages/volto/src/reducers/types/types.js b/packages/volto/src/reducers/types/types.js index a7705c1b17..29b2fbcfb7 100644 --- a/packages/volto/src/reducers/types/types.js +++ b/packages/volto/src/reducers/types/types.js @@ -4,11 +4,8 @@ */ import { GET_CONTENT, GET_TYPES } from '@plone/volto/constants/ActionTypes'; -import { - flattenToAppURL, - getBaseUrl, - hasApiExpander, -} from '@plone/volto/helpers'; +import { flattenToAppURL, getBaseUrl } from '@plone/volto/helpers/Url/Url'; +import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils'; const initialState = { error: null, diff --git a/packages/volto/src/reducers/users/users.js b/packages/volto/src/reducers/users/users.js index 429a3fab11..1eb3d296ed 100644 --- a/packages/volto/src/reducers/users/users.js +++ b/packages/volto/src/reducers/users/users.js @@ -3,7 +3,7 @@ * @module reducers/users/users */ -import { startsWith } from 'lodash'; +import startsWith from 'lodash/startsWith'; import { CREATE_USER, diff --git a/packages/volto/src/reducers/workingcopy/workingcopy.js b/packages/volto/src/reducers/workingcopy/workingcopy.js index 0a9737c195..fe75c885dc 100644 --- a/packages/volto/src/reducers/workingcopy/workingcopy.js +++ b/packages/volto/src/reducers/workingcopy/workingcopy.js @@ -8,7 +8,7 @@ import { CREATE_WORKING_COPY, REMOVE_WORKING_COPY, } from '@plone/volto/constants/ActionTypes'; -import { flattenToAppURL } from '@plone/volto/helpers'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; const initialState = { info: {}, diff --git a/packages/volto/src/routes.js b/packages/volto/src/routes.js index 5884f2364d..ba9208213a 100644 --- a/packages/volto/src/routes.js +++ b/packages/volto/src/routes.js @@ -3,30 +3,30 @@ * @module routes */ import debug from 'debug'; -import { compact } from 'lodash'; -import { - Add, - Aliases, - ChangePassword, - ContactForm, - CreateTranslation, - Delete, - Diff, - Edit, - History, - LinksToItem, - Login, - Logout, - ManageTranslations, - NotFound, - PasswordReset, - Register, - RequestPasswordReset, - Search, - Sharing, - Sitemap, - PersonalInformation, -} from '@plone/volto/components'; +import compact from 'lodash/compact'; + +import Add from '@plone/volto/components/manage/Add/Add'; +import Aliases from '@plone/volto/components/manage/Aliases/Aliases'; +import ChangePassword from '@plone/volto/components/manage/Preferences/ChangePassword'; +import ContactForm from '@plone/volto/components/theme/ContactForm/ContactForm'; +import CreateTranslation from '@plone/volto/components/manage/Multilingual/CreateTranslation'; +import Delete from '@plone/volto/components/manage/Delete/Delete'; +import Diff from '@plone/volto/components/manage/Diff/Diff'; +import Edit from '@plone/volto/components/manage/Edit/Edit'; +import History from '@plone/volto/components/manage/History/History'; +import LinksToItem from '@plone/volto/components/manage/LinksToItem/LinksToItem'; +import Login from '@plone/volto/components/theme/Login/Login'; +import Logout from '@plone/volto/components/theme/Logout/Logout'; +import ManageTranslations from '@plone/volto/components/manage/Multilingual/ManageTranslations'; +import NotFound from '@plone/volto/components/theme/NotFound/NotFound'; +import PasswordReset from '@plone/volto/components/theme/PasswordReset/PasswordReset'; +import Register from '@plone/volto/components/theme/Register/Register'; +import RequestPasswordReset from '@plone/volto/components/theme/PasswordReset/RequestPasswordReset'; +import Search from '@plone/volto/components/theme/Search/Search'; +import Sharing from '@plone/volto/components/manage/Sharing/Sharing'; +import Sitemap from '@plone/volto/components/theme/Sitemap/Sitemap'; +import PersonalInformation from '@plone/volto/components/manage/Preferences/PersonalInformation'; + import { Contents } from '@plone/volto/components/manage/Contents'; import { Rules } from '@plone/volto/components/manage/Rules'; import { @@ -52,8 +52,6 @@ import { UpgradeControlPanel, } 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. import App from '@plone/volto/components/theme/App/App'; import View from '@plone/volto/components/theme/View/View'; diff --git a/packages/volto/src/server.jsx b/packages/volto/src/server.jsx index e8555349fc..d64c4575c3 100644 --- a/packages/volto/src/server.jsx +++ b/packages/volto/src/server.jsx @@ -8,7 +8,7 @@ import express from 'express'; import { renderToString } from 'react-dom/server'; import { createMemoryHistory } from 'history'; import { parse as parseUrl } from 'url'; -import { keys } from 'lodash'; +import keys from 'lodash/keys'; import locale from 'locale'; import { detect } from 'detect-browser'; import path from 'path'; @@ -21,16 +21,16 @@ import debug from 'debug'; import routes from '@root/routes'; import config from '@plone/volto/registry'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; +import Html from '@plone/volto/helpers/Html/Html'; +import Api from '@plone/volto/helpers/Api/Api'; +import { persistAuthToken } from '@plone/volto/helpers/AuthToken/AuthToken'; import { - flattenToAppURL, - Html, - Api, - persistAuthToken, toBackendLang, toGettextLang, toReactIntlLang, -} from '@plone/volto/helpers'; -import { changeLanguage } from '@plone/volto/actions'; +} from '@plone/volto/helpers/Utils/Utils'; +import { changeLanguage } from '@plone/volto/actions/language/language'; import userSession from '@plone/volto/reducers/userSession/userSession'; diff --git a/packages/volto/src/start-client.jsx b/packages/volto/src/start-client.jsx index 4494b118c7..35813c819f 100644 --- a/packages/volto/src/start-client.jsx +++ b/packages/volto/src/start-client.jsx @@ -14,7 +14,9 @@ import routes from '@root/routes'; import config from '@plone/volto/registry'; import configureStore from '@plone/volto/store'; -import { Api, persistAuthToken, ScrollToTop } from '@plone/volto/helpers'; +import Api from '@plone/volto/helpers/Api/Api'; +import { persistAuthToken } from '@plone/volto/helpers/AuthToken/AuthToken'; +import ScrollToTop from '@plone/volto/helpers/ScrollToTop/ScrollToTop'; export const history = createBrowserHistory(); diff --git a/packages/volto/src/storybook.jsx b/packages/volto/src/storybook.jsx index c364ac1421..1a2f658f6a 100644 --- a/packages/volto/src/storybook.jsx +++ b/packages/volto/src/storybook.jsx @@ -6,7 +6,7 @@ import { Provider } from 'react-redux'; import { StaticRouter } from 'react-router-dom'; import { IntlProvider } from 'react-intl'; import { PluggablesProvider } from '@plone/volto/components/manage/Pluggable'; -import { useUndoManager } from '@plone/volto/helpers'; +import useUndoManager from '@plone/volto/helpers/UndoManager/useUndoManager'; import configureStore from 'redux-mock-store'; import configureRealStore from '@plone/volto/store'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb14ba6eb6..110334de1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18938,11 +18938,9 @@ snapshots: '@babel/plugin-transform-modules-commonjs@7.24.1(@babel/core@7.25.8)': dependencies: '@babel/core': 7.25.8 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.25.8) + '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-simple-access': 7.22.5 - transitivePeerDependencies: - - supports-color '@babel/plugin-transform-modules-systemjs@7.24.1(@babel/core@7.24.4)': dependencies: @@ -19573,8 +19571,6 @@ snapshots: '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.24.4) - transitivePeerDependencies: - - supports-color '@babel/preset-typescript@7.24.1(@babel/core@7.25.8)': dependencies: @@ -19584,8 +19580,6 @@ snapshots: '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.8) '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.25.8) '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.25.8) - transitivePeerDependencies: - - supports-color '@babel/register@7.23.7(@babel/core@7.25.8)': dependencies: