From 83fb4c47b2635393553951394c35b12a8add6091 Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Sun, 8 Dec 2024 01:24:05 +0100 Subject: [PATCH] Removed volto-slate/editor/ui/index usage --- docs/source/upgrade-guide/index.md | 1 + .../volto-slate/src/editor/plugins/Blockquote/index.jsx | 2 +- packages/volto-slate/src/editor/plugins/Callout/index.jsx | 2 +- packages/volto-slate/src/editor/plugins/Link/index.jsx | 6 ++---- .../volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx | 2 +- .../volto-slate/src/editor/plugins/Table/TableButton.jsx | 2 +- packages/volto-slate/src/editor/plugins/Table/index.jsx | 2 +- packages/volto-slate/src/elementEditor/ContextButtons.jsx | 2 +- packages/volto-slate/src/elementEditor/ToolbarButton.jsx | 2 +- .../src/components/manage/AnchorPlugin/useLinkEditor.jsx | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/source/upgrade-guide/index.md b/docs/source/upgrade-guide/index.md index fbd3c0c5af..23e2903a18 100644 --- a/docs/source/upgrade-guide/index.md +++ b/docs/source/upgrade-guide/index.md @@ -733,6 +733,7 @@ The barrel imports files include the following in Volto. 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/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 3035c1c4b0..02b507404e 100644 --- a/packages/volto-slate/src/editor/plugins/Link/index.jsx +++ b/packages/volto-slate/src/editor/plugins/Link/index.jsx @@ -13,10 +13,8 @@ import { SIMPLELINK, LINK } from '@plone/volto-slate/constants'; import { LinkElement } from './render'; import { simpleLinkDeserializer, withSimpleLink } from './extensions'; import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; -import { - ToolbarButton as UIToolbarButton, - PositionedToolbar, -} from '@plone/volto-slate/editor/ui'; +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'; diff --git a/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx b/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx index 2df03288de..42548d8e74 100644 --- a/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx +++ b/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx @@ -6,7 +6,7 @@ import cx from 'classnames'; 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/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/elementEditor/ContextButtons.jsx b/packages/volto-slate/src/elementEditor/ContextButtons.jsx index 9902caed0f..3d9d0129cd 100644 --- a/packages/volto-slate/src/elementEditor/ContextButtons.jsx +++ b/packages/volto-slate/src/elementEditor/ContextButtons.jsx @@ -4,7 +4,7 @@ import { useIntl } from 'react-intl'; // , defineMessages import clearSVG from '@plone/volto/icons/delete.svg'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; +import ToolbarButton from '@plone/volto-slate/editor/ui/ToolbarButton'; import { setPluginOptions } from '@plone/volto-slate/actions/plugins'; /* diff --git a/packages/volto-slate/src/elementEditor/ToolbarButton.jsx b/packages/volto-slate/src/elementEditor/ToolbarButton.jsx index 4c3f69c802..9c08c82cc8 100644 --- a/packages/volto-slate/src/elementEditor/ToolbarButton.jsx +++ b/packages/volto-slate/src/elementEditor/ToolbarButton.jsx @@ -6,7 +6,7 @@ import { useSlate } from 'slate-react'; import { useDispatch } from 'react-redux'; import omit from 'lodash/omit'; -import { ToolbarButton } from '@plone/volto-slate/editor/ui'; +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'; 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) {