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/.github/workflows/deployment_tests.yml b/.github/workflows/api-first.yml similarity index 56% rename from .github/workflows/deployment_tests.yml rename to .github/workflows/api-first.yml index 9f6edc6e22..8edf0f2f8e 100644 --- a/.github/workflows/deployment_tests.yml +++ b/.github/workflows/api-first.yml @@ -1,12 +1,49 @@ -name: Deployment Tests +name: API-first story Tests on: [push, pull_request] env: node-version: 22.x jobs: - vitessr: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + config: + runs-on: ubuntu-latest + outputs: + ENVIRONMENT: ${{ steps.vars.outputs.ENVIRONMENT }} + STACK_NAME: ${{ steps.vars.outputs.STACK_NAME }} + nextjs: ${{ steps.filter.outputs.nextjs }} + remix: ${{ steps.filter.outputs.remix }} + rr7: ${{ steps.filter.outputs.rr7 }} + tss: ${{ steps.filter.outputs.tss }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Env Vars + id: vars + run: | + ENVIRONMENT=${{ vars.LIVE_ENV }} + echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_OUTPUT + echo "STACK_NAME=${ENVIRONMENT//./-}" >> $GITHUB_OUTPUT + + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + nextjs: + - 'apps/nextjs/**' + - '.github/workflows/api-first.yml' + remix: + - 'apps/remix/**' + - '.github/workflows/api-first.yml' + rr7: + - 'apps/rr7/**' + - '.github/workflows/api-first.yml' + tss: + - 'apps/vite-ssr/**' + - '.github/workflows/api-first.yml' + + tss: + if: ${{ needs.config.outputs.tss == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) runs-on: ubuntu-latest name: Vite SSR timeout-minutes: 5 @@ -68,7 +105,8 @@ jobs: run: make backend-docker-detached-stop nextjs: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + # if: ${{ needs.config.outputs.nextjs == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) + if: false runs-on: ubuntu-latest name: Next.JS timeout-minutes: 5 @@ -130,7 +168,7 @@ jobs: run: make backend-docker-detached-stop remix: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + if: ${{ needs.config.outputs.remix == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) runs-on: ubuntu-latest name: Remix timeout-minutes: 5 @@ -174,7 +212,63 @@ jobs: run: pnpm --filter plone-remix build - name: Start server - run: nohup pnpm --filter plone-remix start:prod & + run: PLONE_API_PATH=http://localhost:8080/Plone nohup pnpm --filter plone-remix start:prod & + + - name: Wait + run: packages/scripts/node_modules/.bin/wait-on --httpTimeout 20000 http-get://127.0.0.1:8080/Plone + + - name: Run tests + run: node packages/scripts/check_deployment.js + + - name: Stop backend + run: make backend-docker-detached-stop + + rr7: + if: ${{ needs.config.outputs.rr7 == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) + runs-on: ubuntu-latest + name: ReactRouter 7 + timeout-minutes: 5 + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + + # node setup + - name: Use Node.js ${{ env.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.node-version }} + + - name: Enable corepack + run: corepack enable + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build dependencies + run: pnpm build:all + + - name: Start backend + run: make backend-docker-detached-start + + - name: Build + run: pnpm --filter plone-rr7 build + + - name: Start server + run: PLONE_API_PATH=http://localhost:8080/Plone nohup pnpm --filter plone-rr7 start:prod & - name: Wait run: packages/scripts/node_modules/.bin/wait-on --httpTimeout 20000 http-get://127.0.0.1:8080/Plone diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 418c2c4f18..b9616ac57d 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -20,7 +20,7 @@ jobs: - name: Install towncrier run: pip install towncrier - - uses: dorny/paths-filter@v2 + - uses: dorny/paths-filter@v3 id: filter with: filters: | @@ -42,6 +42,12 @@ jobs: - 'packages/scripts/**' voltoSlate: - 'packages/volto-slate/**' + blocks: + - 'packages/blocks/**' + slots: + - 'packages/slots/**' + theming: + - 'packages/theming/**' wrongNews: - added|modified: 'news/**' @@ -120,6 +126,30 @@ jobs: env: BASE_BRANCH: ${{ github.base_ref }} + - name: Blocks changelog check + if: steps.filter.outputs.blocks == 'true' + run: | + git fetch --no-tags origin main + towncrier check --compare-with origin/main --dir packages/blocks + env: + BASE_BRANCH: ${{ github.base_ref }} + + - name: Slots changelog check + if: steps.filter.outputs.slots == 'true' + run: | + git fetch --no-tags origin main + towncrier check --compare-with origin/main --dir packages/slots + env: + BASE_BRANCH: ${{ github.base_ref }} + + - name: Theming changelog check + if: steps.filter.outputs.theming == 'true' + run: | + git fetch --no-tags origin main + towncrier check --compare-with origin/main --dir packages/theming + env: + BASE_BRANCH: ${{ github.base_ref }} + - name: Wrong location of news changelog check if: steps.filter.outputs.wrongNews == 'true' run: echo "News items should be moved from the repository root to the appropriate package root in `packages/package-name`." && exit 1 diff --git a/.stylelintignore b/.stylelintignore index 1521c8b765..4b2be235a0 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1 +1,4 @@ dist +docs +node_modules +packages/registry/lib diff --git a/PACKAGES.md b/PACKAGES.md index 5e12ae1955..5f72ef477c 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -2,17 +2,37 @@ This document describes the packages that come with Volto, the default frontend for Plone 6. +These packages are part of Plone's API-first story. +Most of them are experimental and are marked in their respective `README` files. +Plone 6.1.x (Volto 18) depends on: +- `@plone/registry` +- `@plone/scripts` +- `@plone/volto-slate` + +and as a development dependency: +- `@plone/types` + +Plone 6.0.x (Volto 17 and below) does not use any of them. + +These packages are expected to be used and become part of Plone 7. +Some of them might become part of Plone 6.1.x minor versions. + +The packages are divided into three categories or types: + +- core +- utilities +- add-ons + ## `@plone/types` Plone types is a special development package. It contains the Plone typings for TypeScript. -It's considered a core package, and it's the only package that the other core packages can rely on as -a `devDependency` in your project configuration. +It's considered a core package, and it's the only package that the other core packages can rely on as a `devDependency` in your project configuration. This package contains `.d.ts` typing definitions, curated by hand. -Due to the nature of this package, it does not need bundling. -It's published "as is", so you can import the type definitions from anywhere in your code. +Due to the nature of this package, it does not need to be built nor bundled. +It is published "as is", so you can import the type definitions from anywhere in your code. ## Core packages @@ -29,12 +49,10 @@ They must be published and bundled in a traditional (transpiled) way. The bundle of these packages must work on both CommonJS and ECMAScript Module (ESM) environments. -## Utility packages +## Utilities packages -- `@plone/drivers` -- `@plone/helpers` - `@plone/providers` -- `@plone/rsc` +- `@plone/helpers` ### Rules @@ -44,19 +62,22 @@ They must be published in the traditional way, as a bundle. This bundle must work on both CommonJS and ESM environments. -## Feature packages +## Add-on packages - `@plone/blocks` -- `@plone/contents` - `@plone/slots` +- `@plone/theming` +- `@plone/contents` ### Rules -Feature packages, or add-on packages, can depend on any other package. +Add-on or feature packages, can depend on any other package. You must distribute them as source code, and not transpile them. They must provide a default configuration registry loader as the default main entry point export. -They must be loadable as any other add-on. +Unlike Volto add-ons, do *NOT* place the code in the `src` folder. +If you do not transpile the package, the direct resolution must work out of the box, where both the bundler and TypeScript resolution are direct. +They must be loadable as any other add-on, and contain an add-on registry compatible `install`-able default export. ## Development utility packages diff --git a/apps/remix/.gitignore b/apps/remix/.gitignore index 3f7bf98da3..8bf74e0cf1 100644 --- a/apps/remix/.gitignore +++ b/apps/remix/.gitignore @@ -4,3 +4,4 @@ node_modules /build /public/build .env +.registry.loader.js diff --git a/apps/remix/app/client.ts b/apps/remix/app/client.ts index 0eec9cd62e..db178fa7f7 100644 --- a/apps/remix/app/client.ts +++ b/apps/remix/app/client.ts @@ -2,7 +2,7 @@ import ploneClient from '@plone/client'; import config from '@plone/registry'; const cli = ploneClient.initialize({ - apiPath: config.settings.apiPath, + apiPath: config.settings.internalApiPath || config.settings.apiPath, }); export { cli as ploneClient }; diff --git a/apps/remix/app/config.ts b/apps/remix/app/config.ts index ae8881a358..88d1de718f 100644 --- a/apps/remix/app/config.ts +++ b/apps/remix/app/config.ts @@ -1,15 +1,15 @@ import config from '@plone/registry'; -import { blocksConfig, slate } from '@plone/blocks'; - -const settings = { - apiPath: 'http://localhost:8080/Plone', - slate, -}; - -// @ts-expect-error We need to fix typing -config.set('settings', settings); - -// @ts-expect-error We need to fix typing -config.set('blocks', { blocksConfig }); - -export default config; +import applyAddonConfiguration from '@plone/registry/addons-loader'; + +export default function install() { + applyAddonConfiguration(config); + config.settings.apiPath = + process.env.PLONE_API_PATH || 'http://localhost:3000'; + config.settings.internalApiPath = process.env.PLONE_INTERNAL_API_PATH || ''; + console.log('API_PATH is:', config.settings.apiPath); + console.log( + 'INTERNAL_API_PATH is:', + config.settings.internalApiPath || 'not set', + ); + return config; +} diff --git a/apps/remix/app/routes/_index.tsx b/apps/remix/app/content.tsx similarity index 61% rename from apps/remix/app/routes/_index.tsx rename to apps/remix/app/content.tsx index 2ad6a19bbe..3e8a562784 100644 --- a/apps/remix/app/routes/_index.tsx +++ b/apps/remix/app/content.tsx @@ -7,14 +7,16 @@ import { dehydrate, QueryClient, HydrationBoundary, + useQueryClient, useQuery, } from '@tanstack/react-query'; -import { flattenToAppURL } from '../utils'; +import { flattenToAppURL } from './utils'; import { useLoaderData, useLocation } from '@remix-run/react'; import { usePloneClient } from '@plone/providers'; -import { Breadcrumbs, RenderBlocks } from '@plone/components'; -import config from '@plone/registry'; -import { ploneClient } from '../client'; +// import { Breadcrumbs, RenderBlocks } from '@plone/components'; +// import config from '@plone/registry'; +import { ploneClient } from './client'; +import App from '@plone/slots/components/App'; export const meta: MetaFunction = () => { return [ @@ -23,7 +25,7 @@ export const meta: MetaFunction = () => { ]; }; -const expand = ['breadcrumbs', 'navigation']; +const expand = ['navroot', 'breadcrumbs', 'navigation']; // eslint-disable-next-line @typescript-eslint/no-unused-vars export const loader = async ({ params, request }: LoaderFunctionArgs) => { @@ -40,7 +42,7 @@ export const loader = async ({ params, request }: LoaderFunctionArgs) => { const { getContentQuery } = ploneClient; await queryClient.prefetchQuery( - getContentQuery({ path: flattenToAppURL(request.url), expand }), + getContentQuery({ path: flattenToAppURL(request.url || '/'), expand }), ); return json({ dehydratedState: dehydrate(queryClient) }); @@ -48,31 +50,23 @@ export const loader = async ({ params, request }: LoaderFunctionArgs) => { function Page() { const { getContentQuery } = usePloneClient(); - const pathname = useLocation().pathname; - const { data } = useQuery(getContentQuery({ path: pathname, expand })); + const { pathname } = useLocation(); + const { data } = useQuery(getContentQuery({ path: pathname || '/', expand })); if (!data) return null; return ( <> - - + ); } -export default function Index() { +export default function Content() { const { dehydratedState } = useLoaderData(); + const queryClient = useQueryClient(); return ( - + ); diff --git a/apps/remix/app/entry.client.tsx b/apps/remix/app/entry.client.tsx index 4680b84a57..b1f2b5cf0b 100644 --- a/apps/remix/app/entry.client.tsx +++ b/apps/remix/app/entry.client.tsx @@ -3,11 +3,12 @@ * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ * For more information, see https://remix.run/file-conventions/entry.client */ - +import install from './config'; import { RemixBrowser } from '@remix-run/react'; import { startTransition, StrictMode } from 'react'; import { hydrateRoot } from 'react-dom/client'; -import './config'; + +install(); startTransition(() => { hydrateRoot( diff --git a/apps/remix/app/entry.server.tsx b/apps/remix/app/entry.server.tsx index 9af132970a..64f8029dd8 100644 --- a/apps/remix/app/entry.server.tsx +++ b/apps/remix/app/entry.server.tsx @@ -11,10 +11,12 @@ import { createReadableStreamFromReadable } from '@remix-run/node'; import { RemixServer } from '@remix-run/react'; import { isbot } from 'isbot'; import { renderToPipeableStream } from 'react-dom/server'; -import './config'; +import install from './config'; const ABORT_DELAY = 5_000; +install(); + export default function handleRequest( request: Request, responseStatusCode: number, diff --git a/apps/remix/app/root.tsx b/apps/remix/app/root.tsx index ecfb28c8be..5d49a06f99 100644 --- a/apps/remix/app/root.tsx +++ b/apps/remix/app/root.tsx @@ -17,18 +17,16 @@ import PloneClient from '@plone/client'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import '@plone/components/dist/basic.css'; +import '@plone/slots/main.css'; import { flattenToAppURL } from './utils'; import { PloneProvider } from '@plone/providers'; + import config from '@plone/registry'; export const links: LinksFunction = () => [ ...(cssBundleHref ? [{ rel: 'stylesheet', href: cssBundleHref }] : []), ]; -function useHrefLocal(to: string) { - return useHref(flattenToAppURL(to)); -} - export default function App() { const [queryClient] = useState( () => @@ -55,6 +53,10 @@ export default function App() { return RRNavigate(flattenToAppURL(to)); }; + function useHrefLocal(to: string) { + return useHref(flattenToAppURL(to)); + } + return ( @@ -71,6 +73,7 @@ export default function App() { useParams={useParams} useHref={useHrefLocal} navigate={navigate} + flattenToAppURL={flattenToAppURL} > diff --git a/apps/remix/app/routes/$.tsx b/apps/remix/app/routes/$.tsx deleted file mode 100644 index abd1fd4bbd..0000000000 --- a/apps/remix/app/routes/$.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { - json, - type LoaderFunctionArgs, - type MetaFunction, -} from '@remix-run/node'; -import { - dehydrate, - QueryClient, - HydrationBoundary, - useQuery, -} from '@tanstack/react-query'; -import { flattenToAppURL } from '../utils'; -import { useLoaderData, useLocation } from '@remix-run/react'; -import { usePloneClient } from '@plone/providers'; -import { Breadcrumbs, RenderBlocks } from '@plone/components'; -import config from '@plone/registry'; -import { ploneClient } from '../client'; - -export const meta: MetaFunction = () => { - return [ - { title: 'Plone on Remix' }, - { name: 'description', content: 'Welcome to Plone on Remix!' }, - ]; -}; - -const expand = ['breadcrumbs', 'navigation']; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const loader = async ({ params, request }: LoaderFunctionArgs) => { - const queryClient = new QueryClient({ - defaultOptions: { - queries: { - // With SSR, we usually want to set some default staleTime - // above 0 to avoid refetching immediately on the client - staleTime: 60 * 1000, - }, - }, - }); - - const { getContentQuery } = ploneClient; - - await queryClient.prefetchQuery( - getContentQuery({ path: flattenToAppURL(request.url), expand }), - ); - - return json({ dehydratedState: dehydrate(queryClient) }); -}; - -function Page() { - const { getContentQuery } = usePloneClient(); - const pathname = useLocation().pathname; - const { data } = useQuery(getContentQuery({ path: pathname, expand })); - - if (!data) return null; - return ( - <> - - - - ); -} - -export default function Index() { - const { dehydratedState } = useLoaderData(); - - return ( - - - - ); -} diff --git a/apps/remix/app/utils.ts b/apps/remix/app/utils.ts index c297613f90..186833cc1d 100644 --- a/apps/remix/app/utils.ts +++ b/apps/remix/app/utils.ts @@ -1,4 +1,4 @@ -import config from './config'; +import config from '@plone/registry'; /** * Flatten to app server URL - Given a URL if it starts with the API server URL @@ -9,9 +9,11 @@ import config from './config'; */ export function flattenToAppURL(url: string) { const { settings } = config; - - return ( + const result = url && - url.replace(settings.apiPath, '').replace('http://localhost:3000', '') - ); + url + .replace(settings.apiPath, '') + .replace(settings.internalApiPath || '', '') + .replace('http://localhost:3000', ''); + return result; } diff --git a/apps/remix/package.json b/apps/remix/package.json index 31d7ec65e8..4af4ff9935 100644 --- a/apps/remix/package.json +++ b/apps/remix/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@plone/blocks": "workspace: *", + "@plone/slots": "workspace: *", "@plone/client": "workspace: *", "@plone/components": "workspace: *", "@plone/providers": "workspace: *", diff --git a/apps/remix/registry.config.ts b/apps/remix/registry.config.ts new file mode 100644 index 0000000000..15b9c3f5d2 --- /dev/null +++ b/apps/remix/registry.config.ts @@ -0,0 +1,4 @@ +const addons = ['@plone/blocks', '@plone/slots']; +const theme = ''; + +export { addons, theme }; diff --git a/apps/remix/remix.config.js b/apps/remix/remix.config.js deleted file mode 100644 index 812df9d051..0000000000 --- a/apps/remix/remix.config.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('@remix-run/dev').AppConfig} */ -export default { - ignoredRouteFiles: ['**/.*'], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // publicPath: "/build/", - // serverBuildPath: "build/index.js", -}; diff --git a/apps/remix/vite.config.ts b/apps/remix/vite.config.ts index 03bfa30a99..d8694b0580 100644 --- a/apps/remix/vite.config.ts +++ b/apps/remix/vite.config.ts @@ -4,8 +4,41 @@ import tsconfigPaths from 'vite-tsconfig-paths'; import { PloneRegistryVitePlugin } from '@plone/registry/vite-plugin'; export default defineConfig({ + server: { + port: 3000, + proxy: { + '^/\\+\\+api\\+\\+($$|/.*)': { + target: + 'http://localhost:8080/VirtualHostBase/http/localhost:3000/Plone/++api++/VirtualHostRoot', + rewrite: (path) => { + console.log(path); + return path.replace('/++api++', ''); + }, + }, + }, + }, plugins: [ remix({ + routes: async (defineRoutes) => { + // If you need to do async work, do it before calling `defineRoutes`, we use + // the call stack of `route` inside to set nesting. + + return defineRoutes((route) => { + route('/', 'content.tsx', { id: 'index' }); + route('*', 'content.tsx', { id: 'splat' }); + // A common use for this is catchall routes. + // - The first argument is the React Router path to match against + // - The second is the relative filename of the route handler + // route("/some/path/*", "catchall.tsx"); + + // if you want to nest routes, use the optional callback argument + // route("some/:path", "some/route/file.js", () => { + // // - path is relative to parent path + // // - filenames are still relative to the app directory + // route("relative/path", "some/other/file"); + // }); + }); + }, future: { v3_fetcherPersist: true, v3_relativeSplatPath: true, @@ -15,7 +48,4 @@ export default defineConfig({ tsconfigPaths(), PloneRegistryVitePlugin(), ], - server: { - port: 3000, - }, }); diff --git a/apps/rr7/.eslintrc.cjs b/apps/rr7/.eslintrc.cjs index b4a6a65b4d..d1480fca9f 100644 --- a/apps/rr7/.eslintrc.cjs +++ b/apps/rr7/.eslintrc.cjs @@ -38,6 +38,7 @@ module.exports = { react: { version: 'detect', }, + 'import/core-modules': ['@plone/registry/addons-loader'], formComponents: ['Form'], linkComponents: [ { name: 'Link', linkAttribute: 'to' }, diff --git a/apps/rr7/app/client.ts b/apps/rr7/app/client.ts deleted file mode 100644 index 0eec9cd62e..0000000000 --- a/apps/rr7/app/client.ts +++ /dev/null @@ -1,8 +0,0 @@ -import ploneClient from '@plone/client'; -import config from '@plone/registry'; - -const cli = ploneClient.initialize({ - apiPath: config.settings.apiPath, -}); - -export { cli as ploneClient }; diff --git a/apps/rr7/app/config.server.ts b/apps/rr7/app/config.server.ts new file mode 100644 index 0000000000..2d7c951f7d --- /dev/null +++ b/apps/rr7/app/config.server.ts @@ -0,0 +1,32 @@ +/** + * This is the server side config entry point + */ +import config from '@plone/registry'; +import ploneClient from '@plone/client'; +import applyAddonConfiguration from '@plone/registry/addons-loader'; + +export default function install() { + applyAddonConfiguration(config); + + config.settings.apiPath = + process.env.PLONE_API_PATH || 'http://localhost:3000'; + config.settings.internalApiPath = + process.env.PLONE_INTERNAL_API_PATH || undefined; + + const cli = ploneClient.initialize({ + apiPath: config.settings.internalApiPath || config.settings.apiPath, + }); + + config.registerUtility({ + name: 'ploneClient', + type: 'client', + method: () => cli, + }); + + console.log('API_PATH is:', config.settings.apiPath); + console.log( + 'INTERNAL_API_PATH is:', + config.settings.internalApiPath || 'not set', + ); + return config; +} diff --git a/apps/rr7/app/config.ts b/apps/rr7/app/config.ts index e7133efdce..7f2026e538 100644 --- a/apps/rr7/app/config.ts +++ b/apps/rr7/app/config.ts @@ -1,15 +1,11 @@ +/** + * This is the client side config entry point + */ import config from '@plone/registry'; -import { blocksConfig, slate } from '@plone/blocks'; +import applyAddonConfiguration from '@plone/registry/addons-loader'; -const settings = { - apiPath: 'http://localhost:3000', - slate, -}; - -// @ts-expect-error We need to fix typing -config.set('settings', settings); - -// @ts-expect-error We need to fix typing -config.set('blocks', { blocksConfig }); - -export default config; +export default function install() { + applyAddonConfiguration(config); + config.settings.apiPath = 'http://localhost:3000'; + return config; +} diff --git a/apps/rr7/app/routes/home.tsx b/apps/rr7/app/content.tsx similarity index 63% rename from apps/rr7/app/routes/home.tsx rename to apps/rr7/app/content.tsx index c470ad9f42..5433ba9fda 100644 --- a/apps/rr7/app/routes/home.tsx +++ b/apps/rr7/app/content.tsx @@ -1,4 +1,4 @@ -import type { LoaderArgs } from '../routes/+types.home'; +import type { LoaderArgs } from './routes/+types.home'; import { dehydrate, QueryClient, @@ -6,14 +6,13 @@ import { useQuery, useQueryClient, } from '@tanstack/react-query'; -import { flattenToAppURL } from '../utils'; import { useLoaderData, useLocation } from 'react-router'; +import type { MetaFunction } from 'react-router'; import { usePloneClient } from '@plone/providers'; -import { Breadcrumbs, RenderBlocks } from '@plone/components'; +import PloneClient from '@plone/client'; +import App from '@plone/slots/components/App'; +import { flattenToAppURL } from './utils'; import config from '@plone/registry'; -import { ploneClient } from '../client'; - -import type { MetaFunction } from 'react-router'; export const meta: MetaFunction = () => { return [ @@ -22,7 +21,7 @@ export const meta: MetaFunction = () => { ]; }; -const expand = ['breadcrumbs', 'navigation']; +const expand = ['navroot', 'breadcrumbs', 'navigation']; // eslint-disable-next-line @typescript-eslint/no-unused-vars export async function loader({ params, request }: LoaderArgs) { @@ -36,11 +35,28 @@ export async function loader({ params, request }: LoaderArgs) { }, }); - const { getContentQuery } = ploneClient; + const ploneClient = config + .getUtility({ + name: 'ploneClient', + type: 'client', + }) + .method(); - await queryClient.prefetchQuery( - getContentQuery({ path: flattenToAppURL(request.url), expand }), - ); + const { getContentQuery } = ploneClient as PloneClient; + + const path = flattenToAppURL(request.url); + if ( + !( + /^https?:\/\//.test(path) || + /^favicon.ico\/\//.test(path) || + /expand/.test(path) || + /^\/@@images/.test(path) || + /^\/@@download/.test(path) || + /^\/assets/.test(path) + ) + ) { + await queryClient.prefetchQuery(getContentQuery({ path, expand })); + } return { dehydratedState: dehydrate(queryClient) }; } @@ -51,20 +67,7 @@ function Page() { const { data } = useQuery(getContentQuery({ path: pathname, expand })); if (!data) return 'Loading...'; - return ( - <> - - - - ); + return ; } export default function Content() { diff --git a/apps/rr7/app/okroute.tsx b/apps/rr7/app/okroute.tsx new file mode 100644 index 0000000000..56472e1bb6 --- /dev/null +++ b/apps/rr7/app/okroute.tsx @@ -0,0 +1,5 @@ +export async function loader() { + return new Response(null, { + status: 200, + }); +} diff --git a/apps/rr7/app/root.tsx b/apps/rr7/app/root.tsx index 50808c5b17..d1c4bb5bae 100644 --- a/apps/rr7/app/root.tsx +++ b/apps/rr7/app/root.tsx @@ -7,8 +7,9 @@ import { ScrollRestoration, useHref, useLocation, - useNavigate, + useNavigate as useRRNavigate, useParams, + useLoaderData, } from 'react-router'; import type { LinksFunction } from 'react-router'; @@ -18,9 +19,18 @@ import PloneClient from '@plone/client'; import { PloneProvider } from '@plone/providers'; import { flattenToAppURL } from './utils'; import config from '@plone/registry'; -import './config'; +import install from './config'; +import installSSR from './config.server'; -import '@plone/components/dist/basic.css'; +install(); + +import '@plone/theming/styles/main.css'; +import '@plone/slots/main.css'; + +function useNavigate() { + const navigate = useRRNavigate(); + return (to: string) => navigate(flattenToAppURL(to)); +} function useHrefLocal(to: string) { return useHref(flattenToAppURL(to)); @@ -35,11 +45,24 @@ export const links: LinksFunction = () => [ }, { rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap', + href: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap', }, ]; +export async function loader() { + const ssrConfig = installSSR(); + + return { + env: { + PLONE_API_PATH: ssrConfig.settings.apiPath, + PLONE_INTERNAL_API_PATH: ssrConfig.settings.internalApiPath, + }, + }; +} + export function Layout({ children }: { children: React.ReactNode }) { + const data = useLoaderData(); + return ( @@ -51,6 +74,11 @@ export function Layout({ children }: { children: React.ReactNode }) { {children} + \ No newline at end of file diff --git a/packages/slots/.storybook/preview.ts b/packages/slots/.storybook/preview.ts new file mode 100644 index 0000000000..362843c9bc --- /dev/null +++ b/packages/slots/.storybook/preview.ts @@ -0,0 +1,24 @@ +import './storybook-base.css'; +import '@plone/components/dist/basic.css'; +import '../main.css'; +import config from '@plone/registry'; +import installSlots from '../config'; +import installBlocks from '@plone/blocks'; + +config.set('slots', {}); +config.set('utilities', {}); +installSlots(config); +installBlocks(config); + +export const parameters = { + backgrounds: { + default: 'light', + }, + actions: { argTypesRegex: '^on[A-Z].*' }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, +}; diff --git a/packages/slots/.storybook/storybook-base.css b/packages/slots/.storybook/storybook-base.css new file mode 100644 index 0000000000..f55ba4bf27 --- /dev/null +++ b/packages/slots/.storybook/storybook-base.css @@ -0,0 +1,19 @@ +/* Base styles */ +:root { + --basic-font-family: system-ui; + --basic-font-size: 16px; + background: var(--background-color); + font-family: var(--basic-font-family); + font-size: var(--basic-font-size); + line-height: 1.5; +} + +.sbdocs.sbdocs-content { + p { + font-size: 16px; + } +} + +#storybook-root { + width: 100vw; +} diff --git a/packages/slots/.storybook/theme.ts b/packages/slots/.storybook/theme.ts new file mode 100644 index 0000000000..3262e1f700 --- /dev/null +++ b/packages/slots/.storybook/theme.ts @@ -0,0 +1,10 @@ +import { create } from '@storybook/theming/create'; +import logo from './Logo.svg'; + +export default create({ + base: 'light', + brandTitle: '@plone/components StoryBook', + brandUrl: 'https://plone-components.netlify.app/', + brandImage: logo, + brandTarget: '_self', +}); diff --git a/packages/slots/.stylelintrc b/packages/slots/.stylelintrc new file mode 100644 index 0000000000..8ac62f8d0f --- /dev/null +++ b/packages/slots/.stylelintrc @@ -0,0 +1,14 @@ +{ + "extends": ["stylelint-config-idiomatic-order"], + "plugins": ["stylelint-prettier"], + "overrides": [ + { + "files": ["**/*.scss"], + "customSyntax": "postcss-scss" + } + ], + "rules": { + "prettier/prettier": true, + "order/properties-alphabetical-order": null + } +} diff --git a/packages/slots/CHANGELOG.md b/packages/slots/CHANGELOG.md new file mode 100644 index 0000000000..1eb8ee8211 --- /dev/null +++ b/packages/slots/CHANGELOG.md @@ -0,0 +1,11 @@ +# @plone/slots Release Notes + + + + + +## 1.0.0 (unreleased) diff --git a/packages/slots/README.md b/packages/slots/README.md index c77e2bb2de..8dae40cad3 100644 --- a/packages/slots/README.md +++ b/packages/slots/README.md @@ -1,6 +1,6 @@ -# `@plone/blocks` +# `@plone/slots` -This package contains the default blocks provided by Plone. +This package provides default structural slots for Plone 7 and the API-first story. > [!WARNING] > This package or app is experimental. diff --git a/packages/slots/SlotRenderer.tsx b/packages/slots/SlotRenderer.tsx new file mode 100644 index 0000000000..df2501d721 --- /dev/null +++ b/packages/slots/SlotRenderer.tsx @@ -0,0 +1,58 @@ +import config from '@plone/registry'; +import type { GetSlotArgs } from '@plone/types'; + +export type SlotComponentProps = { + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; + navRoot?: GetSlotArgs['navRoot']; +}; + +/* + * The SlotRenderer component is used to render the components registered for a + * given slot. + * + * Usage: + * + */ +const SlotRenderer = ({ + name, + content, + location, + navRoot, +}: { + name: string; + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; + navRoot?: GetSlotArgs['navRoot']; +}) => { + let slots = config.getSlot(name, { + content, + location, + // This is to cover the use case while adding a new content and we don't have + // the navRoot information in the initial content. This will be + // useful for SlotRenderers rendered in the `Add` route. + navRoot: content?.['@components']?.navroot?.navroot || navRoot, + }); + + if (!slots) { + return null; + } + + return ( + <> + {slots.map(({ component, name }) => { + const SlotComponent = component; + return ( + + ); + })} + + ); +}; + +export default SlotRenderer; diff --git a/packages/slots/components/App.stories.tsx b/packages/slots/components/App.stories.tsx new file mode 100644 index 0000000000..6dce553dfb --- /dev/null +++ b/packages/slots/components/App.stories.tsx @@ -0,0 +1,61 @@ +import App from './App'; + +import type { Meta, StoryObj } from '@storybook/react'; +import { storyData } from '../stories'; + +const meta = { + title: 'App', + component: App, + parameters: { + layout: 'centered', + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: (args: any) => , + args: { + content: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + description: 'Welcome to Plone', + items: [], + blocks: { + ...storyData.blocks, + }, + blocks_layout: { + ...storyData.blocks_layout, + }, + '@components': { + navigation: { + items: [ + { + '@id': 'http://localhost:3000/Plone', + title: 'Home', + }, + { + '@id': 'http://localhost:3000/Plone/news', + title: 'News', + }, + { + '@id': 'http://localhost:3000/Plone/about', + title: 'About', + }, + ], + }, + navroot: { + // @ts-expect-error This is a test object, missing all content properties + navroot: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + }, + }, + site: { + 'plone.site_title': 'Plone site', + }, + }, + }, + }, +}; diff --git a/packages/slots/components/App.tsx b/packages/slots/components/App.tsx new file mode 100644 index 0000000000..9f703a2be2 --- /dev/null +++ b/packages/slots/components/App.tsx @@ -0,0 +1,25 @@ +import type { GetSlotArgs } from '@plone/types'; +import SlotRenderer from '../SlotRenderer'; + +type AppProps = { + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; +}; + +const App = (props: AppProps) => { + const { content, location } = props; + + return ( +
+
+ +
+ +
+ +
+
+ ); +}; + +export default App; diff --git a/packages/slots/components/ContentArea.tsx b/packages/slots/components/ContentArea.tsx new file mode 100644 index 0000000000..b4cd5dfc4a --- /dev/null +++ b/packages/slots/components/ContentArea.tsx @@ -0,0 +1,19 @@ +import RenderBlocks from '@plone/blocks/RenderBlocks/RenderBlocks'; +import { SlotComponentProps } from '../SlotRenderer'; +import config from '@plone/registry'; + +const ContentArea = (props: SlotComponentProps) => { + const { content } = props; + + return ( + <> + + + ); +}; + +export default ContentArea; diff --git a/packages/slots/components/Footer.tsx b/packages/slots/components/Footer.tsx new file mode 100644 index 0000000000..626340a642 --- /dev/null +++ b/packages/slots/components/Footer.tsx @@ -0,0 +1,21 @@ +import type { GetSlotArgs } from '@plone/types'; +import SlotRenderer from '../SlotRenderer'; + +type FooterProps = { + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; +}; + +const Footer = (props: FooterProps) => { + const { content, location } = props; + + return ( + <> + + + + + ); +}; + +export default Footer; diff --git a/packages/slots/components/Header.stories.tsx b/packages/slots/components/Header.stories.tsx new file mode 100644 index 0000000000..d90e0f251f --- /dev/null +++ b/packages/slots/components/Header.stories.tsx @@ -0,0 +1,55 @@ +import Header from './Header'; + +import type { Meta, StoryObj } from '@storybook/react'; + +const meta = { + title: 'Header', + component: Header, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: (args: any) =>
, + args: { + content: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + description: 'Welcome to Plone', + items: [], + '@components': { + navigation: { + items: [ + { + '@id': 'http://localhost:3000/Plone', + title: 'Home', + }, + { + '@id': 'http://localhost:3000/Plone/news', + title: 'News', + }, + { + '@id': 'http://localhost:3000/Plone/about', + title: 'About', + }, + ], + }, + navroot: { + // @ts-expect-error This is a test object, missing all content properties + navroot: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + }, + }, + site: { + 'plone.site_title': 'Plone site', + }, + }, + }, + }, +}; diff --git a/packages/slots/components/Header.tsx b/packages/slots/components/Header.tsx new file mode 100644 index 0000000000..1b2d743082 --- /dev/null +++ b/packages/slots/components/Header.tsx @@ -0,0 +1,28 @@ +import type { GetSlotArgs } from '@plone/types'; +import SlotRenderer from '../SlotRenderer'; +import { Container } from '@plone/components'; + +type HeaderProps = { + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; +}; + +const Header = (props: HeaderProps) => { + const { content, location } = props; + + return ( + + + +
+ +
+
+ ); +}; + +export default Header; diff --git a/packages/slots/components/Logo.stories.tsx b/packages/slots/components/Logo.stories.tsx new file mode 100644 index 0000000000..93d2623f27 --- /dev/null +++ b/packages/slots/components/Logo.stories.tsx @@ -0,0 +1,40 @@ +import React from 'react'; +import Logo from './Logo'; + +import type { Meta, StoryObj } from '@storybook/react'; + +const meta = { + title: 'Logo', + component: Logo, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: (args: any) => , + args: { + content: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + description: 'Welcome to Plone', + items: [], + '@components': { + navroot: { + // @ts-expect-error This is a test object, missing all content properties + navroot: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + }, + }, + site: { + 'plone.site_title': 'Plone site', + }, + }, + }, + }, +}; diff --git a/packages/slots/components/Logo.svg b/packages/slots/components/Logo.svg new file mode 100644 index 0000000000..5a7ba56902 --- /dev/null +++ b/packages/slots/components/Logo.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/slots/components/Logo.tsx b/packages/slots/components/Logo.tsx new file mode 100644 index 0000000000..d543931753 --- /dev/null +++ b/packages/slots/components/Logo.tsx @@ -0,0 +1,27 @@ +import { SlotComponentProps } from '../SlotRenderer'; +import { Link } from '@plone/components'; +import LogoImage from './Logo.svg'; +import config from '@plone/registry'; +import { messages } from './messages'; + +const Logo = (props: SlotComponentProps) => { + const { content } = props; + const intl: (id: string) => string = config.getUtility({ + name: 'translation', + type: 'factory', + }).method; + const navRootPath = content['@components'].navroot?.navroot?.['@id'] || '/'; + const site = content['@components'].site; + const siteTitle = site?.['plone.site_title'] || ''; + const logoUrl = site?.['plone.site_logo'] + ? site['plone.site_logo'] + : LogoImage; + + return ( + + {intl(messages.logoOf) + + ); +}; + +export default Logo; diff --git a/packages/slots/components/Main.tsx b/packages/slots/components/Main.tsx new file mode 100644 index 0000000000..454ed36d78 --- /dev/null +++ b/packages/slots/components/Main.tsx @@ -0,0 +1,22 @@ +import type { GetSlotArgs } from '@plone/types'; +import SlotRenderer from '../SlotRenderer'; +import { Container } from '@plone/components'; + +type MainProps = { + content: GetSlotArgs['content']; + location: GetSlotArgs['location']; +}; + +const Main = (props: MainProps) => { + const { content, location } = props; + + return ( + + + + + + ); +}; + +export default Main; diff --git a/packages/slots/components/MainFooter.tsx b/packages/slots/components/MainFooter.tsx new file mode 100644 index 0000000000..d97347f71e --- /dev/null +++ b/packages/slots/components/MainFooter.tsx @@ -0,0 +1,38 @@ +import { SlotComponentProps } from '../SlotRenderer'; +import { Container, Link } from '@plone/components'; +import Logo from './Logo'; + +const Footer = (props: SlotComponentProps) => { + const { content, location } = props; + const siteActions = content?.['@components']?.actions?.site_actions || []; + + return ( + + {/* TODO: i18n properly */} +
+ The Plone® Open Source CMS/WCM is © 2000-2024 by the Plone Foundation + and friends.
+ Distributed under the GNU GPL license. +
+
    + {siteActions?.length + ? siteActions.map((item) => ( +
  • + + {item?.title} + +
  • + )) + : null} +
+ + + + + Powered by Plone & Python + +
+ ); +}; + +export default Footer; diff --git a/packages/slots/components/Navigation.stories.tsx b/packages/slots/components/Navigation.stories.tsx new file mode 100644 index 0000000000..3aee92ac77 --- /dev/null +++ b/packages/slots/components/Navigation.stories.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import Navigation from './Navigation'; + +import type { Meta, StoryObj } from '@storybook/react'; + +const meta = { + title: 'Navigation', + component: Navigation, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: (args: any) => , + args: { + content: { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + description: 'Welcome to Plone', + items: [], + '@components': { + navigation: { + items: [ + { + '@id': 'http://localhost:3000/Plone', + title: 'Plone site', + }, + { + '@id': 'http://localhost:3000/Plone/news', + title: 'News', + }, + { + '@id': 'http://localhost:3000/Plone/about', + title: 'About', + }, + ], + }, + }, + }, + }, +}; diff --git a/packages/slots/components/Navigation.tsx b/packages/slots/components/Navigation.tsx new file mode 100644 index 0000000000..afccd4ae93 --- /dev/null +++ b/packages/slots/components/Navigation.tsx @@ -0,0 +1,26 @@ +import type { SlotComponentProps } from '../SlotRenderer'; +import { Link } from '@plone/components'; + +type NavItem = { + '@id': string; + title: string; +}; + +const Navigation = (props: SlotComponentProps) => { + const { content } = props; + const navItems = content['@components'].navigation?.items || []; + + return ( + + ); +}; + +export default Navigation; diff --git a/packages/slots/components/Tools.tsx b/packages/slots/components/Tools.tsx new file mode 100644 index 0000000000..6718f028e1 --- /dev/null +++ b/packages/slots/components/Tools.tsx @@ -0,0 +1,6 @@ +const HeaderTools = (props) => { + const { content, location } = props; + return 'The tools'; +}; + +export default HeaderTools; diff --git a/packages/slots/components/messages.ts b/packages/slots/components/messages.ts new file mode 100644 index 0000000000..2e2e95fd7d --- /dev/null +++ b/packages/slots/components/messages.ts @@ -0,0 +1,5 @@ +export const messages = { + home: 'Home', + siteLogo: 'Site logo', + logoOf: 'Logo of', +}; diff --git a/packages/slots/index.ts b/packages/slots/index.ts new file mode 100644 index 0000000000..885e8d2778 --- /dev/null +++ b/packages/slots/index.ts @@ -0,0 +1,78 @@ +import type { ConfigType } from '@plone/registry'; +import App from './components/App'; +import Header from './components/Header'; +import Main from './components/Main'; +import Footer from './components/Footer'; +import Logo from './components/Logo'; +import Navigation from './components/Navigation'; +import HeaderTools from './components/Tools'; +import ContentArea from './components/ContentArea'; +import MainFooter from './components/MainFooter'; + +export default function install(config: ConfigType) { + // Translation factory + config.registerUtility({ + name: 'translation', + type: 'factory', + method: (id: string) => id, + }); + + // Main App Slot + config.registerSlotComponent({ name: 'App', slot: 'App', component: App }); + + // Header Slot + config.registerSlotComponent({ + name: 'Header', + slot: 'header', + component: Header, + }); + + // Logo + config.registerSlotComponent({ + name: 'Logo', + slot: 'logo', + component: Logo, + }); + + // Navigation + config.registerSlotComponent({ + name: 'Navigation', + slot: 'navigation', + component: Navigation, + }); + + // Tools + config.registerSlotComponent({ + name: 'Tools', + slot: 'headertools', + component: HeaderTools, + }); + + // Main Slot + config.registerSlotComponent({ + name: 'Main', + slot: 'main', + component: Main, + }); + + config.registerSlotComponent({ + name: 'contentArea', + slot: 'contentArea', + component: ContentArea, + }); + + // Footer Slot + config.registerSlotComponent({ + name: 'Footer', + slot: 'footer', + component: Footer, + }); + + config.registerSlotComponent({ + name: 'mainFooter', + slot: 'mainFooter', + component: MainFooter, + }); + + return config; +} diff --git a/packages/slots/main.css b/packages/slots/main.css new file mode 100644 index 0000000000..32062cf557 --- /dev/null +++ b/packages/slots/main.css @@ -0,0 +1,100 @@ +:root { + /* These should come from @plone/components by default */ + --layout-container-width: 1440px; + --default-container-width: 940px; + --narrow-container-width: 620px; + + --align-right: end; + --align-left: start; + --align-center: center; +} + +body { + /* This needs a proper reset */ + margin: 0; +} + +.app-slot { + display: grid; + height: 100vh; + margin: 0; + grid-template-areas: + 'header' + 'content' + 'footer'; + grid-template-columns: 1fr; + grid-template-rows: auto 1fr auto; +} + +.header-logo-nav-tools-wrapper { + display: flex; + flex-direction: row; + align-items: baseline; + justify-content: space-between; + padding-top: 25px; + padding-bottom: 35px; +} + +.logo { + flex: 1 1 0; + align-self: center; +} + +.navigation { + display: flex; + flex: 3.5 1 0; + align-self: center; + justify-content: center; + + ul { + display: flex; + padding: 0; + margin: 0; + list-style: none; + + li a { + padding: 1rem 0; + margin-left: 1rem; + } + + li:first-child a { + margin-left: 0; + } + } +} + +.header-tools { + display: flex; + flex: 1 1 0; + flex-direction: row-reverse; +} + +main { + grid-area: 'content'; +} + +.content-area > * { + max-width: var(--default-container-width); + margin-right: auto; + margin-left: auto; +} + +figure img { + width: 100%; +} + +footer { + margin-top: 100px; +} + +.footer { + display: flex; + flex-direction: column; + padding: 2rem 0; + text-align: center; + + .logo { + margin: 20px 0; + place-self: center; + } +} diff --git a/packages/slots/news/.gitkeep b/packages/slots/news/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/slots/news/6409.internal b/packages/slots/news/6409.internal new file mode 100644 index 0000000000..5712bbc003 --- /dev/null +++ b/packages/slots/news/6409.internal @@ -0,0 +1 @@ +Initial commit, first steps. @sneridagh diff --git a/packages/slots/package.json b/packages/slots/package.json index 9766de2823..e6a8658cc0 100644 --- a/packages/slots/package.json +++ b/packages/slots/package.json @@ -28,13 +28,15 @@ "publishConfig": { "access": "public" }, - "main": "src/index.ts", + "main": "index.ts", "scripts": { "test": "vitest", "dry-release": "release-it --dry-run", "release": "release-it", "release-major-alpha": "release-it major --preRelease=alpha", - "release-alpha": "release-it --preRelease=alpha" + "release-alpha": "release-it --preRelease=alpha", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -46,16 +48,33 @@ } }, "dependencies": { - "@plone/providers": "workspace:*", - "@plone/registry": "workspace:*" + "@plone/blocks": "workspace:*", + "@plone/client": "workspace:*", + "@plone/components": "workspace:*", + "@plone/registry": "workspace:*", + "react-aria-components": "^1.4.0" }, "devDependencies": { "@plone/types": "workspace:*", + "@storybook/addon-essentials": "^8.0.4", + "@storybook/addon-interactions": "^8.0.4", + "@storybook/addon-links": "^8.0.4", + "@storybook/addon-mdx-gfm": "^8.0.4", + "@storybook/blocks": "^8.0.4", + "@storybook/manager-api": "^8.0.4", + "@storybook/react": "^8.0.4", + "@storybook/react-vite": "^8.0.4", + "@storybook/theming": "^8.0.4", "@types/react": "^18", "@types/react-dom": "^18", + "eslint-plugin-storybook": "^0.8.0", + "jest-axe": "^8.0.0", "release-it": "17.1.1", + "storybook": "^8.0.4", "tsconfig": "workspace:*", "typescript": "^5.6.3", - "vitest": "^2.1.3" + "vite": "^5.4.8", + "vitest": "^2.1.3", + "vitest-axe": "^0.1.0" } } diff --git a/packages/slots/setupTesting.ts b/packages/slots/setupTesting.ts new file mode 100644 index 0000000000..8bc87fa36e --- /dev/null +++ b/packages/slots/setupTesting.ts @@ -0,0 +1,3 @@ +import '@testing-library/jest-dom'; +import { toHaveNoViolations } from 'jest-axe'; +expect.extend(toHaveNoViolations); diff --git a/packages/slots/src/SlotRenderer.tsx b/packages/slots/src/SlotRenderer.tsx deleted file mode 100644 index a2567dee6f..0000000000 --- a/packages/slots/src/SlotRenderer.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import { useRouterLocation } from '@plone/providers'; -import config from '@plone/registry'; - -import type { Content } from '@plone/types'; - -/* -Usage: - -*/ - -const SlotRenderer = ({ - name, - content, - navRoot, -}: { - name: string; - content: Content; - navRoot?: Content; -}) => { - const pathname = useRouterLocation().pathname; - - let slots = config.getSlot(name, { - content, - pathname, - // This is to cover the use case while adding a new content and we don't have - // have the navRoot information in the initial content. This will be - // useful for SlotRenderers rendered in the `Add` route. - navRoot: content?.['@components']?.navroot?.navroot || navRoot, - }); - - if (!slots) { - return null; - } - - return ( - <> - {slots.map( - ({ - component, - name, - }: { - component: React.ComponentType; - name: string; - }) => { - // ^^ Weird compilation issue for Jest tests, that forced to re-declare the type above - const SlotComponent = component; - return ( - - ); - }, - )} - - ); -}; - -export default SlotRenderer; diff --git a/packages/slots/src/index.ts b/packages/slots/src/index.ts deleted file mode 100644 index 6fe8d63809..0000000000 --- a/packages/slots/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SlotRenderer'; diff --git a/packages/slots/stories.ts b/packages/slots/stories.ts new file mode 100644 index 0000000000..6a668df163 --- /dev/null +++ b/packages/slots/stories.ts @@ -0,0 +1,22 @@ +export const storyData = { + blocks: { + '7ab29abe-b38c-406b-94d7-b270e544a998': { + '@type': 'slate', + value: [ + { + type: 'p', + children: [ + { + text: 'Lorem ipsum dolor sit amet eu tempus ornare elit. Curabitur egestas quisque molestie pellentesque nunc imperdiet posuere morbi nunc eleifend. Volutpat enim augue blandit aliquam interdum pulvinar eu mattis congue. Eleifend mauris ut fermentum egestas mi faucibus adipiscing arcu nibh scelerisque justo habitasse. Mi consectetur hac maecenas leo dictumst vitae phasellus quam praesent vivamus nullam imperdiet integer mauris.', + }, + ], + }, + ], + plaintext: + 'Lorem ipsum dolor sit amet eu tempus ornare elit. Curabitur egestas quisque molestie pellentesque nunc imperdiet posuere morbi nunc eleifend. Volutpat enim augue blandit aliquam interdum pulvinar eu mattis congue. Eleifend mauris ut fermentum egestas mi faucibus adipiscing arcu nibh scelerisque justo habitasse. Mi consectetur hac maecenas leo dictumst vitae phasellus quam praesent vivamus nullam imperdiet integer mauris.', + }, + }, + blocks_layout: { + items: ['7ab29abe-b38c-406b-94d7-b270e544a998'], + }, +}; diff --git a/packages/slots/towncrier.toml b/packages/slots/towncrier.toml new file mode 100644 index 0000000000..3ef721f378 --- /dev/null +++ b/packages/slots/towncrier.toml @@ -0,0 +1,33 @@ +[tool.towncrier] +filename = "CHANGELOG.md" +directory = "news/" +title_format = "## {version} ({project_date})" +underlines = ["", "", ""] +template = "../scripts/templates/towncrier_template.jinja" +start_string = "\n" +issue_format = "[#{issue}](https://github.com/plone/volto/issues/{issue})" + +[[tool.towncrier.type]] +directory = "breaking" +name = "Breaking" +showcontent = true + +[[tool.towncrier.type]] +directory = "feature" +name = "Feature" +showcontent = true + +[[tool.towncrier.type]] +directory = "bugfix" +name = "Bugfix" +showcontent = true + +[[tool.towncrier.type]] +directory = "internal" +name = "Internal" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation" +showcontent = true diff --git a/packages/slots/tsconfig.json b/packages/slots/tsconfig.json index 27e48db56e..2965402840 100644 --- a/packages/slots/tsconfig.json +++ b/packages/slots/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "tsconfig/react-library.json", - "include": ["src", "src/**/*.js", "../providers/src/RouterLocation.tsx"], + "include": ["**/*.ts", "**/*.tsx"], "exclude": [ "node_modules", "build", diff --git a/packages/slots/vitest.config.ts b/packages/slots/vitest.config.ts new file mode 100644 index 0000000000..fddf5f61f7 --- /dev/null +++ b/packages/slots/vitest.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vitest/config'; + +// https://vitejs.dev/config/ +export default defineConfig({ + test: { + globals: true, + environment: 'jsdom', + setupFiles: './setupTesting.ts', + // you might want to disable it, if you don't have tests that rely on CSS + // since parsing CSS is slow + css: true, + exclude: ['**/node_modules/**', '**/lib/**'], + }, +}); diff --git a/packages/theming/.release-it.json b/packages/theming/.release-it.json new file mode 100644 index 0000000000..708ed7fca5 --- /dev/null +++ b/packages/theming/.release-it.json @@ -0,0 +1,29 @@ +{ + "plugins": { + "../scripts/prepublish.js": {} + }, + "hooks": { + "after:bump": [ + "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", + "pipx run towncrier build --yes --version ${version}" + ], + "after:release": "rm .changelog.draft" + }, + "npm": { + "publish": false + }, + "git": { + "commitArgs": ["--no-verify"], + "changelog": "pipx run towncrier build --draft --yes --version 0.0.0", + "requireUpstream": false, + "requireCleanWorkingDir": false, + "commitMessage": "Release @plone/theming ${version}", + "tagName": "plone-theming-${version}", + "tagAnnotation": "Release @plone/theming ${version}" + }, + "github": { + "release": true, + "releaseName": "@plone/theming ${version}", + "releaseNotes": "cat .changelog.draft" + } +} diff --git a/packages/theming/.stylelintrc b/packages/theming/.stylelintrc new file mode 100644 index 0000000000..8ac62f8d0f --- /dev/null +++ b/packages/theming/.stylelintrc @@ -0,0 +1,14 @@ +{ + "extends": ["stylelint-config-idiomatic-order"], + "plugins": ["stylelint-prettier"], + "overrides": [ + { + "files": ["**/*.scss"], + "customSyntax": "postcss-scss" + } + ], + "rules": { + "prettier/prettier": true, + "order/properties-alphabetical-order": null + } +} diff --git a/packages/theming/CHANGELOG.md b/packages/theming/CHANGELOG.md new file mode 100644 index 0000000000..d3ab18563b --- /dev/null +++ b/packages/theming/CHANGELOG.md @@ -0,0 +1,11 @@ +# @plone/theming Release Notes + + + + + +## 1.0.0 (unreleased) diff --git a/packages/theming/README.md b/packages/theming/README.md new file mode 100644 index 0000000000..6d4db8dc8e --- /dev/null +++ b/packages/theming/README.md @@ -0,0 +1,8 @@ +# @plone/theming + +Base fundamental theming infrastructure for Plone 7 and the API-first story. + +> [!WARNING] +> This package or app is experimental. +> The community offers no support whatsoever for it. +> Breaking changes may occur without notice. diff --git a/packages/theming/index.ts b/packages/theming/index.ts new file mode 100644 index 0000000000..7258290153 --- /dev/null +++ b/packages/theming/index.ts @@ -0,0 +1,5 @@ +import type { ConfigType } from '@plone/registry'; + +export default function install(config: ConfigType) { + return config; +} diff --git a/packages/theming/news/.gitkeep b/packages/theming/news/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/theming/news/6409.internal b/packages/theming/news/6409.internal new file mode 100644 index 0000000000..5712bbc003 --- /dev/null +++ b/packages/theming/news/6409.internal @@ -0,0 +1 @@ +Initial commit, first steps. @sneridagh diff --git a/packages/theming/package.json b/packages/theming/package.json new file mode 100644 index 0000000000..688bd0231c --- /dev/null +++ b/packages/theming/package.json @@ -0,0 +1,79 @@ +{ + "name": "@plone/theming", + "description": "Plone base foundamental theming", + "maintainers": [ + { + "name": "Plone Foundation", + "url": "https://plone.org" + } + ], + "funding": "https://github.com/sponsors/plone", + "license": "MIT", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "https://github.com/plone/volto.git" + }, + "bugs": { + "url": "https://github.com/plone/volto/issues" + }, + "homepage": "https://plone.org", + "keywords": [ + "volto", + "plone", + "plone6", + "react", + "helpers" + ], + "publishConfig": { + "access": "public" + }, + "main": "index.ts", + "scripts": { + "test": "vitest", + "dry-release": "release-it --dry-run", + "release": "release-it", + "release-major-alpha": "release-it major --preRelease=alpha", + "release-alpha": "release-it --preRelease=alpha", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + }, + "dependencies": { + "@plone/components": "workspace:*", + "@plone/registry": "workspace:*", + "lightningcss": "1.28.1", + "lightningcss-cli": "1.28.1" + }, + "devDependencies": { + "@plone/types": "workspace:*", + "@storybook/addon-essentials": "^8.0.4", + "@storybook/addon-interactions": "^8.0.4", + "@storybook/addon-links": "^8.0.4", + "@storybook/addon-mdx-gfm": "^8.0.4", + "@storybook/blocks": "^8.0.4", + "@storybook/manager-api": "^8.0.4", + "@storybook/react": "^8.0.4", + "@storybook/react-vite": "^8.0.4", + "@storybook/theming": "^8.0.4", + "@types/react": "^18", + "@types/react-dom": "^18", + "eslint-plugin-storybook": "^0.8.0", + "jest-axe": "^8.0.0", + "release-it": "17.1.1", + "storybook": "^8.0.4", + "tsconfig": "workspace:*", + "typescript": "^5.6.3", + "vite": "^5.4.8", + "vitest": "^2.1.3", + "vitest-axe": "^0.1.0" + } +} diff --git a/packages/theming/styles/base.css b/packages/theming/styles/base.css new file mode 100644 index 0000000000..66bee507e3 --- /dev/null +++ b/packages/theming/styles/base.css @@ -0,0 +1,8 @@ +body { + font-family: var(--basic-font-family, system-ui); + font-size: var(--basic-font-size, 16px); +} + +figure { + margin: 0; +} diff --git a/packages/theming/styles/layout.css b/packages/theming/styles/layout.css new file mode 100644 index 0000000000..630985a3f3 --- /dev/null +++ b/packages/theming/styles/layout.css @@ -0,0 +1,3 @@ +/* body { + background-color: red; +} */ diff --git a/packages/theming/styles/main.css b/packages/theming/styles/main.css new file mode 100644 index 0000000000..c3db9e90b1 --- /dev/null +++ b/packages/theming/styles/main.css @@ -0,0 +1,5 @@ +@layer reset, plone-components, layout, addons, theme; +@import 'reset.css'; +@import 'base.css'; +@import '@plone/components/dist/basic.css'; +@import 'layout.css'; diff --git a/packages/theming/styles/reset.css b/packages/theming/styles/reset.css new file mode 100644 index 0000000000..31cdac9449 --- /dev/null +++ b/packages/theming/styles/reset.css @@ -0,0 +1,224 @@ +/* Borrowed from https://www.miriamsuzanne.com */ +@layer reset { + /* @docs + label: Core Remedies + version: 0.1.0-beta.2 + + note: | + These remedies are recommended + as a starter for any project. + + category: file + */ + /* @docs + label: Box Sizing + + note: | + Use border-box by default, globally. + + category: global + */ + *, + ::before, + ::after { + box-sizing: border-box; + } + /* @docs + label: Line Sizing + + note: | + Consistent line-spacing, + even when inline elements have different line-heights. + + links: + - https://drafts.csswg.org/css-inline-3/#line-sizing-property + + category: global + */ + html { + line-sizing: normal; + } + /* @docs + label: Body Margins + + note: | + Remove the tiny space around the edge of the page. + + category: global + */ + body { + margin: 0; + } + /* @docs + label: Heading Sizes + + note: | + Switch to rem units for headings + + category: typography + */ + h1 { + font-size: 2rem; + } + h2 { + font-size: 1.5rem; + } + h3 { + font-size: 1.17rem; + } + h4 { + font-size: 1rem; + } + h5 { + font-size: 0.83rem; + } + h6 { + font-size: 0.67rem; + } + /* @docs + label: H1 Margins + + note: | + Keep h1 margins consistent, even when nested. + + category: typography + */ + h1 { + margin: 0.67em 0; + } + /* @docs + label: Pre Wrapping + + note: | + Overflow by default is bad... + + category: typography + */ + pre { + white-space: pre-wrap; + } + /* @docs + label: Horizontal Rule + + note: | + 1. Solid, thin horizontal rules + 2. Remove Firefox `color: gray` + 3. Remove default `1px` height, and common `overflow: hidden` + + category: typography + */ + hr { + overflow: visible; + height: 0; + border-width: 1px 0 0; + border-style: solid; + color: inherit; + } + /* @docs + label: Responsive Embeds + + note: | + 1. Block display is usually what we want + 2. Remove strange space-below when inline + 3. Responsive by default + + category: embedded elements + */ + img, + svg, + video, + canvas, + audio, + iframe, + embed, + object { + display: block; + max-width: 100%; + vertical-align: middle; + } + /* @docs + label: Aspect Ratios + + note: | + Maintain intrinsic aspect ratios when `max-width` is applied. + `iframe`, `embed`, and `object` are also embedded, + but have no intrinsic ratio, + so their `height` needs to be set explicitly. + + category: embedded elements + */ + img, + svg, + video, + canvas { + height: auto; + } + /* @docs + label: Audio Width + + note: | + There is no good reason elements default to 300px, + and audio files are unlikely to come with a width attribute. + + category: embedded elements + */ + audio { + width: 100%; + } + /* @docs + label: Image Borders + + note: | + Remove the border on images inside links in IE 10 and earlier. + + category: legacy browsers + */ + img { + border-style: none; + } + /* @docs + label: SVG Overflow + + note: | + Hide the overflow in IE 10 and earlier. + + category: legacy browsers + */ + svg { + overflow: hidden; + } + /* @docs + label: HTML5 Elements + + note: | + Default block display on HTML5 elements + + category: legacy browsers + */ + article, + aside, + figcaption, + figure, + footer, + header, + hgroup, + main, + nav, + section { + display: block; + } + /* @docs + label: Checkbox & Radio Inputs + + note: | + 1. Add the correct box sizing in IE 10 + 2. Remove the padding in IE 10 + + category: legacy browsers + */ + [type='checkbox'], + [type='radio'] { + box-sizing: border-box; + padding: 0; + } +} diff --git a/packages/theming/towncrier.toml b/packages/theming/towncrier.toml new file mode 100644 index 0000000000..3ef721f378 --- /dev/null +++ b/packages/theming/towncrier.toml @@ -0,0 +1,33 @@ +[tool.towncrier] +filename = "CHANGELOG.md" +directory = "news/" +title_format = "## {version} ({project_date})" +underlines = ["", "", ""] +template = "../scripts/templates/towncrier_template.jinja" +start_string = "\n" +issue_format = "[#{issue}](https://github.com/plone/volto/issues/{issue})" + +[[tool.towncrier.type]] +directory = "breaking" +name = "Breaking" +showcontent = true + +[[tool.towncrier.type]] +directory = "feature" +name = "Feature" +showcontent = true + +[[tool.towncrier.type]] +directory = "bugfix" +name = "Bugfix" +showcontent = true + +[[tool.towncrier.type]] +directory = "internal" +name = "Internal" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation" +showcontent = true diff --git a/packages/theming/tsconfig.json b/packages/theming/tsconfig.json new file mode 100644 index 0000000000..4df9070106 --- /dev/null +++ b/packages/theming/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, + + "strict": true, + "noImplicitOverride": true, + + "lib": ["es2022", "dom", "dom.iterable"], + "module": "preserve", + "noEmit": true, + + "jsx": "react-jsx", + + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + + "paths": {} + }, + "include": ["src/index.ts"], + "exclude": [ + "node_modules", + "build", + "public", + "coverage", + "src/**/*.test.{js,jsx,ts,tsx}", + "src/**/*.spec.{js,jsx,ts,tsx}", + "src/**/*.stories.{js,jsx,ts,tsx}" + ] +} diff --git a/packages/types/.release-it.json b/packages/types/.release-it.json index 11f1e08e9e..3db3e87c46 100644 --- a/packages/types/.release-it.json +++ b/packages/types/.release-it.json @@ -4,7 +4,8 @@ }, "hooks": { "after:bump": [ - "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}" + "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", + "pipx run towncrier build --yes --version ${version}" ], "after:release": "rm .changelog.draft" }, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 7ff1b32ec2..f22cfb03e7 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,4 +1,4 @@ -# @plone/volto-types Release Notes +# @plone/types Release Notes +## 1.1.0 (2024-12-12) + +### Feature + +- Added block category type. @sneridagh [#6409](https://github.com/plone/volto/issues/6409) + ## 1.0.0 (2024-10-31) ### Internal -- Release 1.0.0 @sneridagh +- Release 1.0.0 @sneridagh ## 1.0.0-alpha.22 (2024-10-30) diff --git a/packages/types/package.json b/packages/types/package.json index d19561a391..5af91ff0e4 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -9,7 +9,7 @@ ], "funding": "https://github.com/sponsors/plone", "license": "MIT", - "version": "1.0.0", + "version": "1.1.0", "repository": { "type": "git", "url": "https://github.com/plone/volto.git" diff --git a/packages/types/src/config/Blocks.d.ts b/packages/types/src/config/Blocks.d.ts index 70bf61c5cf..ae5f50fc83 100644 --- a/packages/types/src/config/Blocks.d.ts +++ b/packages/types/src/config/Blocks.d.ts @@ -51,6 +51,10 @@ export interface BlockConfigBase { * The group of the block */ group: string; + /** + * The category of the block + */ + category: string; /** * The view mode component */ 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/CHANGELOG.md b/packages/volto-slate/CHANGELOG.md index b930fd335e..a76fe74282 100644 --- a/packages/volto-slate/CHANGELOG.md +++ b/packages/volto-slate/CHANGELOG.md @@ -8,6 +8,24 @@ +## 18.0.4 (2024-12-12) + +### Bugfix + +- Stylelint in less file. @sneridagh [#6409](https://github.com/plone/volto/issues/6409) + +## 18.0.3 (2024-12-09) + +### Internal + +- Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520) + +## 18.0.2 (2024-12-08) + +### Internal + +- Removed all imports from barrel files for components, actions, helpers, hooks and lodash. @pnicolli [#6509](https://github.com/plone/volto/issues/6509) + ## 18.0.1 (2024-11-11) ### Feature diff --git a/packages/volto-slate/package.json b/packages/volto-slate/package.json index 6113f34a3b..b98b7b27bc 100644 --- a/packages/volto-slate/package.json +++ b/packages/volto-slate/package.json @@ -1,6 +1,6 @@ { "name": "@plone/volto-slate", - "version": "18.0.1", + "version": "18.0.4", "description": "Slate.js integration with Volto", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", 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/Cell.test.js b/packages/volto-slate/src/blocks/Table/Cell.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/Cell.test.js rename to packages/volto-slate/src/blocks/Table/Cell.test.jsx diff --git a/packages/volto-slate/src/blocks/Table/TableBlockEdit.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/TableBlockEdit.test.js b/packages/volto-slate/src/blocks/Table/TableBlockEdit.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/TableBlockEdit.test.js rename to packages/volto-slate/src/blocks/Table/TableBlockEdit.test.jsx diff --git a/packages/volto-slate/src/blocks/Table/TableBlockView.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/Table/TableBlockView.test.js b/packages/volto-slate/src/blocks/Table/TableBlockView.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/TableBlockView.test.js rename to packages/volto-slate/src/blocks/Table/TableBlockView.test.jsx diff --git a/packages/volto-slate/src/blocks/Text/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/TextBlockEdit.test.js b/packages/volto-slate/src/blocks/Text/TextBlockEdit.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Text/TextBlockEdit.test.js rename to packages/volto-slate/src/blocks/Text/TextBlockEdit.test.jsx diff --git a/packages/volto-slate/src/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/less/editor.less b/packages/volto-slate/src/editor/less/editor.less index e6006e3c19..9fb0538eef 100644 --- a/packages/volto-slate/src/editor/less/editor.less +++ b/packages/volto-slate/src/editor/less/editor.less @@ -27,9 +27,9 @@ } .link-form-container { - margin-left: 2px; display: flex; align-items: center; + margin-left: 2px; } } @@ -44,6 +44,7 @@ .slate-toolbar { display: flex; + min-width: 300px; // needed for image widget slate toolbar box-sizing: border-box; padding: 3px; border: none; @@ -53,7 +54,6 @@ font-family: 'Poppins', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 1rem; font-weight: normal; - min-width: 300px; // needed for image widget slate toolbar .expando { flex-grow: 1; 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/editor/ui/ToolbarButton.test.js b/packages/volto-slate/src/editor/ui/ToolbarButton.test.jsx similarity index 100% rename from packages/volto-slate/src/editor/ui/ToolbarButton.test.js rename to packages/volto-slate/src/editor/ui/ToolbarButton.test.jsx diff --git a/packages/volto-slate/src/elementEditor/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.jsx similarity index 98% rename from packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js rename to packages/volto-slate/src/elementEditor/makeInlineElementPlugin.jsx index 0cf45e3d0e..65fde10cd4 100644 --- a/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js +++ b/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.jsx @@ -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..a6b04e24c1 --- /dev/null +++ b/packages/volto/.eslintrc.core.js @@ -0,0 +1,43 @@ +/** 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 = { + 'react/jsx-filename-extension': ['warn', { extensions: ['.tsx', '.jsx'] }], + '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/CHANGELOG.md b/packages/volto/CHANGELOG.md index 791e5af741..0db013fbbd 100644 --- a/packages/volto/CHANGELOG.md +++ b/packages/volto/CHANGELOG.md @@ -17,6 +17,48 @@ myst: +## 18.3.0 (2024-12-12) + +### Feature + +- Add disable Teaser block Align handlers for teasers inside containers. @sneridagh [#6527](https://github.com/plone/volto/issues/6527) + +### Bugfix + +- Fix inline comment in `SlotRenderer`. @sneridagh [#6409](https://github.com/plone/volto/issues/6409) +- Enhanced linkintegrity popup and moved all logic in a separate component ContentsDeleteModal @giuliaghisini [#6516](https://github.com/plone/volto/issues/6516) +- Disable initial scroll to top after SSR completion. @Faakhir30 [#6523](https://github.com/plone/volto/issues/6523) +- Add missing styleWrapper style builder information in container/Grid. @sneridagh [#6527](https://github.com/plone/volto/issues/6527) + +## 18.2.3 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations. @sneridagh [#6526](https://github.com/plone/volto/issues/6526) + +## 18.2.2 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh [#6525](https://github.com/plone/volto/issues/6525) + +## 18.2.1 (2024-12-09) + +### Bugfix + +- Fixes ICS download in non-public event content. @sneridagh [#6515](https://github.com/plone/volto/issues/6515) +- Fixed circular import error in dev with HMR in `App` component when imported in the main default config. @sneridagh [#6524](https://github.com/plone/volto/issues/6524) + +### Internal + +- Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520) + +## 18.2.0 (2024-12-08) + +### Internal + +- Removed all imports from barrel files for components, actions, helpers, hooks and lodash. @pnicolli [#6509](https://github.com/plone/volto/issues/6509) + ## 18.1.2 (2024-12-05) ### Bugfix diff --git a/packages/volto/README.md b/packages/volto/README.md new file mode 100644 index 0000000000..63877d3e46 --- /dev/null +++ b/packages/volto/README.md @@ -0,0 +1,172 @@ +# Volto - the default Plone 6 frontend + +Volto logo png +Volto logo png + +[![NPM](https://img.shields.io/npm/v/@plone/volto.svg)](https://www.npmjs.com/package/@plone/volto) +[![Unit Tests](https://github.com/plone/volto/actions/workflows/unit.yml/badge.svg)](https://github.com/plone/volto/actions/workflows/unit.yml) +[![Acceptance Tests](https://github.com/plone/volto/actions/workflows/acceptance.yml/badge.svg)](https://github.com/plone/volto/actions/workflows/acceptance.yml) +[![Build Status Docs](https://github.com/plone/volto/actions/workflows/docs.yml/badge.svg)](https://github.com/plone/volto/actions) + + +## Introduction + +[Volto](https://github.com/plone/volto) is a ReactJS-based frontend for the [Plone](https://plone.org) Content Management System. +It is the default frontend starting with the Plone 6 release. + +[Plone](https://plone.org) is a CMS built on Python with more than 20 years of history and experience. + +Plone has features that appeal to developers and users alike, such as an intuitive editing interface, customizable content types, hierarchical organization, and a sophisticated permissions model. +This allows you to build anything from simple websites to enterprise-grade intranets. + +Volto exposes all these features and communicates with Plone via its [REST API](https://github.com/plone/plone.restapi). + +Volto features the Pastanaga editor, a modern block-based content layout editor. +It is extensible and customizable, so you can adapt the provided default blocks to meet your requirements, or build new ones. + +Volto is extensible using add-ons. +You can build your own or choose from the community released ones: + +- [Volto Add-ons in NPM](https://www.npmjs.com/search?q=keywords%3Avolto-addon%2Cvolto) +- [Volto Awesome](https://github.com/collective/awesome-volto) + + +## Demo + +You can try a Volto online demo at [https://demo.plone.org/](https://demo.plone.org/). + + +## Create a Volto project + +To start a new project using Volto, follow the [Plone installation documentation](https://6.docs.plone.org/install/create-project.html). + + +## Documentation + +You can find the latest documentation at [https://6.docs.plone.org/](https://6.docs.plone.org/volto/index.html). + +For links to trainings and videos, see [Other learning resources](https://6.docs.plone.org/volto/tutorials/index.html). + + +## Supported Plone, Python, and Plone REST API versions + +See [Plone, Python, and Plone REST API compatibility](https://6.docs.plone.org/volto/contributing/version-policy.html#version-policy-plone-python-and-plone-rest-api-compatibility) + +See the [Plone Release Schedule](https://plone.org/download/release-schedule) for details of maintenance and support. + + +## Supported Node.js versions + +See [Node.js version policy](https://6.docs.plone.org/volto/contributing/version-policy.html#version-policy-plone-python-and-plone-rest-api-compatibility). + + +## Supported browsers + +See [Supported browsers](https://6.docs.plone.org/volto/contributing/version-policy.html#version-policy-supported-browsers). + + +## Contributing + +To contribute to the Volto project by writing code, documentation, translations, and so on, please read [Contributing to Plone](https://6.docs.plone.org/contributing/index.html) and [Contributing to Volto](https://6.docs.plone.org/volto/contributing/index.html). + +For newcomers to Volto, Plone, or open source software, you must read and follow [First-time contributors](https://6.docs.plone.org/contributing/first-time.html). + +Since December 2023, this repository has a monorepo structure. +Volto itself is treated as a library and you can find it in the `packages/volto` folder. + + +## Contributors + + + + + + +## License + +MIT License. Copyrights held by the [Plone Foundation](https://plone.org/foundation). + +See [LICENSE.md](LICENSE.md) for details. + + +## Volto in production + +Volto has been actively developed since 2017. +It has been used in production since 2018 on numerous websites. + +The authoritative source of the list of Volto websites in production is maintained at [Awesome Volto](https://github.com/collective/awesome-volto#websites-built-with-volto). + +The Plone Marketing Team copy-pastes its content on a quarterly basis into [They use Plone 6](https://plone.org/why-plone/they-use-plone/they-use-plone-6). + +To ensure your website gets the greatest exposure, add it both to [Awesome Volto](https://github.com/collective/awesome-volto#websites-built-with-volto) and this README. + +- [ASP Area Nord](https://www.aspareanord.it/) (Website of the Public company of personal services of the Modena municipalities in the north area. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Baccanale Imola](https://www.baccanaleimola.it) (Baccanale is a food fair that happens every year in Imola, Italy. Developed by [RedTurtle](https://www.redturtle.it), 2020) +- [Biblioteche Pianura Est](https://bibest.it/it) (Website of the Associated libraries of eastern plain. Developed by [RedTurtle](https://www.redturtle.it/), 2021) +- [BISE](https://biodiversity.europa.eu) (Biodiversity Information System for Europe, developed by [Eau de Web](https://eaudeweb.ro/), 2019) +- [Camera di Commercio dell'Umbria](https://www.umbria.camcom.it) (Website Chamber of Commerce of Umbria. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Camera di Commercio di Reggio Emilia](https://www.emilia.camcom.it) (Website Chamber of Commerce of Reggio Emilia. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Camposanto](https://www.comune.camposanto.mo.it/) (Website of the Municipality of Camposanto. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Cantagallo](https://www.comune.cantagallo.po.it/) (Website of the Municipality of Cantagallo. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Medolla](https://www.comune.medolla.mo.it/) (Website of the Municipality of Medolla. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Mirandola](https://www.comune.mirandola.mo.it/) (Website of the Municipality of Mirandola. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Modena](https://www.comune.modena.it/) (Website of the Municipality of Modena. Developed by [RedTurtle](https://www.redturtle.it), 2020) +- [Comune di San Possidonio](https://www.comune.sanpossidonio.mo.it/) (Website of the Municipality of San Possidonio. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Vaiano](https://www.comune.vaiano.po.it/) (Website of the Municipality of Vaiano. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Comune di Vernio](https://www.comune.vernio.po.it/) (Website of the Municipality of Vernio. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [Debabarreneko mankomunitatea](https://debabarrena.eus/eu) (Website of the Commonwealth of Debabarrena, community of municipalities to centralize waste handling services, developed by [CodeSyntax](https://www.codesyntax.com/en), 2022) +- [Debako Udala / Ayuntamiento de Deba](https://www.deba.eus/eu) (Website of the municipality of Deba, developed by [CodeSyntax](https://www.codesyntax.com/en), 2022) +- [European Environment Agency](https://www.eea.europa.eu/en) (Website of the European Environment Agency. Developed by [Eau de Web](https://eaudeweb.ro), 2023) +- [Energy Climate Union portal for Europe](https://climate-energy.eea.europa.eu/) (Thematic website focusing on European strides towards mitigating climate change, developed by [Eau de Web](https://eaudeweb.ro/), 2020) +- [Excellence at Humboldt-Universität zu Berlin](https://www.alles-beginnt-mit-einer-frage.de) (Website for the excellence initiative of the [Humboldt University Berlin](https://www.hu-berlin.de/de), developed by [kitconcept GmbH](https://kitconcept.com), 2019) +- [Forest Information System for Europe](https://forest.eea.europa.eu) (Thematic website focusing on European forests, developed by [Eau de Web](https://eaudeweb.ro/), 2019) +- [Forschungszentrum Jülich](https://www.fz-juelich.de/de) (Website for Forschungzentrum Jülich, which is one of the largest research institutions in Europe, developed by [kitconcept GmbH](https://kitconcept.com), 2022) +- [German Aerospace Center (DLR)](https://www.dlr.de/de) (The German Aerospace Center (DLR) is the Federal Republic of Germany's research center for aeronautics. With more than 10.000 employees and a yearly budget of more than 1 billion euros, it is one of the largest research institutions in Germany, developed by [kitconcept GmbH](https://kitconcept.com), 2023) +- [Helmholtz-Institut Erlangen-Nürnberg für Erneuerbare Energien (HI-ERN)](https://www.hi-ern.de/de) (Website for HI ERN, a research institution for renewable energies, developed by [kitconcept GmbH](https://kitconcept.com), 2022) +- [Humboldt Labor](https://www.humboldtforum.org/de/programm/dauerangebot/ausstellung/nach-der-natur-14144/) (The Humboldt Lab is a website where the Humboldt University Berlin presents its latest research projects and findings. Developed by [WLDX](https://wldx.de/) and [kitconcept GmbH](https://kitconcept.com), 2020) +- [ILPO](https://ilpo.jyu.fi/) (the registration portal of continuous learning at the University of Jyväskylä. Developed by University of Jyväskylä, 2022) +- [Industrial Emissions portal for Europe](https://industry.eea.europa.eu) (Thematic website focusing on European industrial emissions, developed by [Eau de Web](https://eaudeweb.ro/), 2020) +- [Jobfamilie MEDICE](https://jobfamilie.medice.de/de) (Carrer website for MEDICE Arzneimittel Pütter GmbH & Co. KG), developed by [Werkbank GmbH](https://werkbank.de/), 2020) +- [Lanku](https://www.lanku.eus) (Website for Lanku Kultur Zerbitzuak, a company offering cultural services and improvised Basque verse singing sessions across the Basque Country, developed by [CodeSyntax](https://www.codesyntax.com/en), 2023) +- [Leibniz Institute for Science and Mathematics Education (IPN)](https://www.leibniz-ipn.de/de) (Website of the IPN, a research institute dedicated to issues related to learning and teaching of science, mathematics and computer science in and outside of schools, developed by [Starzel](https://www.starzel.de), 2023) +- [MEDICE Webseite](https://medice.com/de-de) (Website for MEDICE Arzneimittel Pütter GmbH & Co. KG), developed by [Werkbank GmbH](https://werkbank.de/), 2020) +- [Nuova Voce Ecologista](https://nuovavoceecologista.it) (Website of Nuova Voce Ecologista, an Italian green Party, 2020) +- [Osaka University](https://www.osaka-u.ac.jp/en) (Osaka University is considered one of the most prestigious universities in Japan. Developed by [CMScom](https://www.cmscom.jp), 2021) +- [ResOU](https://resou.osaka-u.ac.jp/ja) (ResOU is introducing official researched releases by the University of Osaka, Japan. Developed by [CMScom](https://www.cmscom.jp), 2020) +- [Stradanove](https://www.stradanove.it/) (Website of the Department of Youth Policies of the Municipality of Modena, developed by [RedTurtle](https://www.redturtle.it), 2020) +- [Study guide at University of Jyväskylä](https://studyguide.jyu.fi/2020/en/) (Static website where [Volto is used as a headless CMS for authoring additional content](https://tech.blog.jyu.fi/2020/06/plone-volto-hasura-gatsbyjs-mashup/), 2020) +- [Talke Carrer Website](https://karriere.talke.com/) (Carrer website for [Talke](https://www.talke.com), one of the leading a chemical and petrochemical logistics companies in Germany, developed by [kitconcept GmbH](https://kitconcept.com), 2020) +- [UEU](https://www.ueu.eus) (Website for Udako Euskal Unibertsitatea, a non-profit University offering all its service only in Basque: courses, publications, ... developed by [CodeSyntax](https://www.codesyntax.com/en), 2023) +- [Unione dei Comuni della Val Bisenzio](https://www.bisenzio.it/) (Website of the Municipality union of Val Bisenzio. Developed by [RedTurtle](https://www.redturtle.it), 2021) +- [VHS Ehrenamtsportal](https://vhs-ehrenamtsportal.de) (Website to help volunteers that help refugees for the [German Adult Education Association](https://www.volkshochschule.de/), developed by [kitconcept GmbH](https://kitconcept.com), 2018) +- [VisitModena](https://www.visitmodena.it/it) (Tourist website of the Municipality of Modena, developed by [RedTurtle](https://www.redturtle.it), 2020) +- [WISE-Freshwater](https://water.europa.eu/freshwater) (WISE-Freshwater, the Freshwater Information System for Europe. Developed by [Eau de web](https://eaudeweb.ro) for the European Environmental Agency, 2021) +- [Zeelandia](https://www.zeelandia.de/) (Corporate website for one of the leading bakery ingredients manufacturers in Germany, developed by [kitconcept GmbH](https://kitconcept.com), 2019) + + +### Open-source websites built with Volto + +The following websites have been built with Volto. +You can find their complete source code by following their links. +Please note that complex websites are built on top of Volto add-ons, and most of the time they're just an empty shell for the add-ons. +You should check the dependencies in their `package.json` for more details. + +- [Forest Information System for Europe](https://github.com/eea/fise-frontend) - Volto project for [Forest Information System for Europe website](https://forest.eea.europa.eu) +- [Freshwater Information System for Europe](https://github.com/eea/freshwater-frontend) - Volto project for [Freshwater Information System for Europe website](https://water.europa.eu/freshwater) +- [European Industrial Emissions Portal](https://github.com/eea/industry-frontend ) - Volto project for [European Industrial Emissions Portal website](https://industry.eea.europa.eu) +- [Biodiversity Information System for Europe](https://github.com/eea/bise-frontend) - Volto project for [Biodiversity Information System for Europe website](https://biodiversity.europa.eu) +- [EEA Main Website frontend](https://github.com/eea/eea-website-frontend) - Volto project for [European Environment Agency](https://www.eea.europa.eu/en) +- [Climate and energy in the EU](https://github.com/eea/climate-energy-frontend) - Volto project for [Climate and energy in the EU website](https://climate-energy.eea.europa.eu) +- [volto-bise](https://github.com/eea/volto-bise) - A Volto project packaged as an addon. It provides Theming using a razzle.extend.js provided alias. +- [design-volto-theme](https://github.com/RedTurtle/design-volto-theme) Volto theme for Italian Public Administration +- [2021.ploneconf.org](https://github.com/plone/ploneconf.org/tree/2021) - Volto project for [Plone Conference 2021 site](https://2021.ploneconf.org) +- [2022.ploneconf.org](https://github.com/plone/ploneconf.org/tree/2022) - Volto project for [Plone Conference 2022 site](https://2022.ploneconf.org) +- [2023.ploneconf.org](https://github.com/plone/ploneconf.org/tree/2023) - Volto project for [Plone Conference 2023 site](https://2023.ploneconf.org) +- [plone.org.br](https://github.com/plonegovbr/plone.org.br) - Volto project for the [Brazilian Plone Community](https://plone.org.br) +- [nsw-design-system-plone6-kit](https://github.com/pretagov/nsw-design-system-plone6-kit) - NSW Design System Plone 6 Kit Volto project for [NSW.gov.au sites](https://digitalnsw.pretagov.com.au/) +- [volto-centraalmuseum-theme](https://github.com/intk/volto-centraalmuseum-theme) - Volto project for the [Centraal Museum & Rietveld](https://www.centraalmuseum.nl/nl) made for [INTK](https://www.intk.com/en). +- [volto-eea-design-system](https://github.com/eea/volto-eea-design-system) - EEA Design System Plone 6 Kit Volto project for [European Environment Agency web sites](https://eea.github.io/volto-eea-design-system/) +- [volto-eea-website-theme](https://github.com/eea/volto-eea-website-theme) - EEA Plone 6 Volto Theme for [European Environment Agency web sites](https://www.eea.europa.eu/en) +- [volto-eea-kitkat](https://github.com/eea/volto-eea-kitkat) - A known good set of Volto add-ons to be used within all EEA projects and beyond, made for [European Environment Agency](https://www.eea.europa.eu/en) +- [volto-rietveldschroderhuis-theme](https://github.com/intk/volto-rietveldschroderhuis-theme) - Volto project for the [Rietveld Schröder House](https://www.rietveldschroderhuis.nl/en) made for [INTK](https://www.intk.com/en). +- [volto-zeeuwsmuseum-theme](https://github.com/intk/volto-zeeuwsmuseum-theme) - Volto project for the [Zeeuws Museum](https://www.zeeuwsmuseum.nl/en) made for [INTK](https://www.intk.com/en). diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index e9e7fe90a2..f004a71968 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -559,6 +559,7 @@ msgstr "No es pot editar el disseny per al tipus de contingut {type}{type} kann nicht verändert werden, da das #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1058,12 +1059,12 @@ msgid "Delete row" msgstr "Zeile löschen" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1073,7 +1074,7 @@ msgid "Deleted" msgstr "Gelöscht" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2358,6 +2359,11 @@ msgstr "Schmal" msgid "Navigate back" msgstr "Zurück navigieren" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3240,6 +3246,11 @@ msgstr "Anzuzeigende Spalten wählen" msgid "Select relation" msgstr "Wählen Sie eine Relation" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3437,12 +3448,12 @@ msgid "Small" msgstr "Klein" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3810,6 +3821,11 @@ msgstr "Es gibt Fehler" msgid "There were some errors." msgstr "Es sind Fehler aufgetreten." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3831,7 +3847,7 @@ msgid "This is a working copy of {title}" msgstr "Das ist eine Arbeitskopie von {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4240,7 +4256,7 @@ msgid "View changes" msgstr "Änderungen anzeigen" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4669,12 +4685,12 @@ msgid "intranet" msgstr "Intranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4693,6 +4709,21 @@ msgstr "Mein Nutzername lautet" msgid "leadimage" msgstr "Lead-Bild" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4818,15 +4849,20 @@ msgid "rebuild relations" msgstr "Relationen neu indizieren" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index 2ad5450f89..3ed645594c 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -553,6 +553,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1053,12 +1054,12 @@ msgid "Delete row" msgstr "" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1068,7 +1069,7 @@ msgid "Deleted" msgstr "" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2353,6 +2354,11 @@ msgstr "" msgid "Navigate back" msgstr "" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3235,6 +3241,11 @@ msgstr "" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3432,12 +3443,12 @@ msgid "Small" msgstr "" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3805,6 +3816,11 @@ msgstr "" msgid "There were some errors." msgstr "" +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3826,7 +3842,7 @@ msgid "This is a working copy of {title}" msgstr "" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4235,7 +4251,7 @@ msgid "View changes" msgstr "" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4664,12 +4680,12 @@ msgid "intranet" msgstr "" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4688,6 +4704,21 @@ msgstr "" msgid "leadimage" msgstr "" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4813,15 +4844,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 669fa842da..095307a2a0 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -560,6 +560,7 @@ msgstr "No se puede editar la plantilla de {type} porque el sop #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1060,12 +1061,12 @@ msgid "Delete row" msgstr "Eliminar fila" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "¿Eliminar elementos seleccionados?" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "¿Eliminar este elemento?" @@ -1075,7 +1076,7 @@ msgid "Deleted" msgstr "Eliminado" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2360,6 +2361,11 @@ msgstr "Filtrar" msgid "Navigate back" msgstr "Navegar hacia atrás" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3242,6 +3248,11 @@ msgstr "Seleccionar columnas a mostrar" msgid "Select relation" msgstr "Seleccionar relación" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3439,12 +3450,12 @@ msgid "Small" msgstr "Pequeño" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "Algunos elementos están referenciados por otros contenidos. Al eliminarlos, {brokenReferences} {variation} se romperá." @@ -3812,6 +3823,11 @@ msgstr "Ha habido algunos errores" msgid "There were some errors." msgstr "Hay algunos errores." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3833,7 +3849,7 @@ msgid "This is a working copy of {title}" msgstr "Es una copia de trabajo de {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4242,7 +4258,7 @@ msgid "View changes" msgstr "Mostrar los cambios" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4671,12 +4687,12 @@ msgid "intranet" msgstr "Intranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "elemento" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "elementos" @@ -4695,6 +4711,21 @@ msgstr "Mi nombre de usuario es" msgid "leadimage" msgstr "Imagen Principal" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4820,15 +4851,20 @@ msgid "rebuild relations" msgstr "reconstruir relaciones" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "referencia" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "referencias" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 504f03b20d..a67988bc0c 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -560,6 +560,7 @@ msgstr "Ezin da {type} elementu-motaren itxura aldatu, #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1060,12 +1061,12 @@ msgid "Delete row" msgstr "Ezabatu errenkada" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1075,7 +1076,7 @@ msgid "Deleted" msgstr "Ezabatuta" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2360,6 +2361,11 @@ msgstr "Estutu" msgid "Navigate back" msgstr "Atzera joan" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3242,6 +3248,11 @@ msgstr "Aukeratu erakutsiko diren zutabeak" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3439,12 +3450,12 @@ msgid "Small" msgstr "Txikia" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3812,6 +3823,11 @@ msgstr "Errorea gertatu da" msgid "There were some errors." msgstr "Errorea gertatu da" +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3833,7 +3849,7 @@ msgid "This is a working copy of {title}" msgstr "Hau {title} elementuaren lan-bertsioa da" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4242,7 +4258,7 @@ msgid "View changes" msgstr "Aldaketak ikusi" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4671,12 +4687,12 @@ msgid "intranet" msgstr "Intraneta" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4695,6 +4711,21 @@ msgstr "Nire erabiltzaile izena da" msgid "leadimage" msgstr "Irudi nagusiaren eremua" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4820,15 +4851,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 99ad9cfb65..595f3076a2 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -558,6 +558,7 @@ msgstr "Sisältötyypin {type} asettelua ei voi muokata, koska #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1058,12 +1059,12 @@ msgid "Delete row" msgstr "Poista valittu rivi" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1073,7 +1074,7 @@ msgid "Deleted" msgstr "Poistettu" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2358,6 +2359,11 @@ msgstr "Kavenna" msgid "Navigate back" msgstr "Takaisin" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3240,6 +3246,11 @@ msgstr "Näytettävät sarakkeet" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3437,12 +3448,12 @@ msgid "Small" msgstr "Pieni" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3810,6 +3821,11 @@ msgstr "Lomakkeesta löytyi virheitä" msgid "There were some errors." msgstr "Löytyi joitakin puutteita tai virheitä." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3831,7 +3847,7 @@ msgid "This is a working copy of {title}" msgstr "" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4240,7 +4256,7 @@ msgid "View changes" msgstr "Näytä muutokset" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4669,12 +4685,12 @@ msgid "intranet" msgstr "inranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4693,6 +4709,21 @@ msgstr "Käyttäjätunnukseni" msgid "leadimage" msgstr "nostokuva" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4818,15 +4849,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index fb52823be1..ebc33cfdec 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -560,6 +560,7 @@ msgstr "Impossible de modifier la mise en page pour le type de contenu { #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1060,12 +1061,12 @@ msgid "Delete row" msgstr "Supprimer la ligne" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1075,7 +1076,7 @@ msgid "Deleted" msgstr "Supprimé" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2360,6 +2361,11 @@ msgstr "Étroit" msgid "Navigate back" msgstr "Retour en arrière" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3242,6 +3248,11 @@ msgstr "Sélectionnez les colonnes à afficher" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3439,12 +3450,12 @@ msgid "Small" msgstr "Petit" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3812,6 +3823,11 @@ msgstr "Il y a eu quelques erreurs" msgid "There were some errors." msgstr "Il y a eu quelques erreurs." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3833,7 +3849,7 @@ msgid "This is a working copy of {title}" msgstr "Il sagit d'une copie de travail de {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4242,7 +4258,7 @@ msgid "View changes" msgstr "Voir les changements" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4671,12 +4687,12 @@ msgid "intranet" msgstr "Intranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4695,6 +4711,21 @@ msgstr "Mon nom d'utilisateur est" msgid "leadimage" msgstr "image de garde" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4820,15 +4851,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/hi/LC_MESSAGES/volto.po b/packages/volto/locales/hi/LC_MESSAGES/volto.po index 0028b6e413..3a381829f0 100644 --- a/packages/volto/locales/hi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hi/LC_MESSAGES/volto.po @@ -553,6 +553,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1053,12 +1054,12 @@ msgid "Delete row" msgstr "पंक्ति हटाएँ" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "चयनित आइटम हटाएं?" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "क्या आप इस आइटम को हटाना चाहते हैं?" @@ -1068,7 +1069,7 @@ msgid "Deleted" msgstr "हटा दिया गया" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "इस आइटम को हटाने से {brokenReferences} {variation} टूट जाता है।" @@ -2353,6 +2354,11 @@ msgstr "संकीर्ण" msgid "Navigate back" msgstr "पिछले पृष्ठ पर जाएं" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3235,6 +3241,11 @@ msgstr "प्रदर्शित करने के लिए स्तं msgid "Select relation" msgstr "रिश्ता चुनें" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3432,12 +3443,12 @@ msgid "Small" msgstr "छोटा" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "कुछ आइटम एक फ़ोल्डर भी हो सकते हैं। उन्हें हटा कर आप {containedItemsToDelete} {variation} फ़ोल्डर के अंदर में हटा देंगे।" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "कुछ आइटम अन्य सामग्रियों द्वारा संदर्भित होते हैं। उन्हें हटा कर आप {brokenReferences} {variation} टूट जाएगा।" @@ -3805,6 +3816,11 @@ msgstr "कुछ त्रुटियाँ थीं" msgid "There were some errors." msgstr "कुछ त्रुटियाँ थीं।" +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3826,7 +3842,7 @@ msgid "This is a working copy of {title}" msgstr "यह {title} की काम की प्रतिलिपि है" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "यह आइटम एक फ़ोल्डर भी है। इसे हटाकर आप {containedItemsToDelete} {variation} फ़ोल्डर के अंदर हटा देंगे।" @@ -4235,7 +4251,7 @@ msgid "View changes" msgstr "परिवर्तन देखें" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "इस आइटम के लिए लिंक और संदर्भ देखें" @@ -4664,12 +4680,12 @@ msgid "intranet" msgstr "इंट्रानेट" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "आइटम" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "आइटम्स" @@ -4688,6 +4704,21 @@ msgstr "मेरा उपयोगकर्ता नाम है" msgid "leadimage" msgstr "प्रमुख छवि फ़ील्ड" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4813,15 +4844,20 @@ msgid "rebuild relations" msgstr "रिश्तों को पुनः निर्माण करें" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "संदर्भ" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "संदर्भ" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index d8f9c6b6ec..d5ae249f68 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -90,7 +90,7 @@ msgstr "Aggiungi Add-ons" #. Default: "Add Alternative URL" #: components/manage/Controlpanels/Aliases msgid "Add Alternative URL" -msgstr "" +msgstr "Aggiungi un URL alternativo" #. Default: "Add Content…" #: components/manage/Toolbar/Types @@ -311,12 +311,12 @@ msgstr "L'alias è stato aggiunto" #. Default: "Aliases have been removed." #: components/manage/Controlpanels/Aliases msgid "Aliases have been removed." -msgstr "" +msgstr "Gli Alias sono stati rimossi." #. Default: "Aliases have been uploaded." #: components/manage/Controlpanels/Aliases msgid "Aliases have been uploaded." -msgstr "" +msgstr "Gli Alias sono stati caricati." #. Default: "Alignment" #: components/manage/Blocks/Image/schema @@ -429,7 +429,7 @@ msgstr "Assegnazione" #. Default: "Automatically" #: components/manage/Controlpanels/Aliases msgid "Automatically" -msgstr "" +msgstr "Automaticamente" #. Default: "Available" #: components/manage/Controlpanels/AddonsControlpanel @@ -493,7 +493,7 @@ msgstr "Blocco" #. Default: "Both" #: components/manage/Controlpanels/Aliases msgid "Both" -msgstr "" +msgstr "Entrambi" #. Default: "Both email address and password are case sensitive, check that caps lock is not enabled." #: components/theme/Login/Login @@ -524,7 +524,7 @@ msgstr "Sfoglia i contenuti, rilascia un'immagine o digita un URL" #. Default: "Bulk upload CSV" #: components/manage/Controlpanels/Aliases msgid "BulkUploadAltUrls" -msgstr "" +msgstr "Caricamento massivo CSV" #. Default: "By default, permissions from the container of this item are inherited. If you disable this, only the explicitly defined sharing permissions will be valid. In the overview, the symbol {inherited} indicates an inherited value. Similarly, the symbol {global} indicates a global role, which is managed by the site administrator." #: components/manage/Sharing/Sharing @@ -553,6 +553,7 @@ msgstr "Non è possibile modificare il Layout per il tipo {type}, &, #, /, ?, or others that are illegal in URLs. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be: request,contributors, ., .., "". Cannot contain new lines." #: components/manage/Widgets/IdWidget msgid "Only 7-bit bytes characters are allowed. Cannot contain uppercase letters, special characters: <, >, &, #, /, ?, or others that are illegal in URLs. Cannot start with: _, aq_, @@, ++. Cannot end with __. Cannot be: request,contributors, ., .., "". Cannot contain new lines." -msgstr "" +msgstr "Sono ammessi solo 7-bit bytes di caratteri. Non può contenere lettere maiuscole, caratteris speciali come: <, >, &, #, /, ?, o altri che non sono ammessi negli URLs. Non può iniziare con: _, aq_, @@, ++. Non può finire con: __. Non può essere: request,contributors, ., .., "" Non può contenere nuove righe." #. Default: "Open in a new tab" #: components/manage/Blocks/Image/schema @@ -3235,6 +3241,11 @@ msgstr "Seleziona le colonne da mostrare" msgid "Select relation" msgstr "Seleziona relazione" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "Seleziona una regola" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3432,14 +3443,14 @@ msgid "Small" msgstr "Piccolo" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "Alcuni elementi sono anche una cartella. Eliminandoli eliminerai {containedItemsToDelete} {variation} dentro le cartelle." #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -msgstr "" +msgstr "Alcuni elementi sono referenziati da altri contenuti. Eliminandoli, {brokenReferences} {variation} si romperanno." #. Default: "Some relations are broken. Please fix." #: components/manage/Controlpanels/Relations/Relations @@ -3805,6 +3816,11 @@ msgstr "Si sono verificati degli errori" msgid "There were some errors." msgstr "Si sono verificati degli errori." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "Questi elementi avranno dei collegamenti rotti" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3826,9 +3842,9 @@ msgid "This is a working copy of {title}" msgstr "Questa è una copia di lavoro di {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -msgstr "" +msgstr "Questo elemento è anche una cartella. Eliminandola eliminerai anche i {containedItemsToDelete} {variation} contenuti in questa cartella." #. Default: "This item was locked by {creator} on {date}" #: components/manage/LockingToastsFactory/LockingToastsFactory @@ -4200,7 +4216,7 @@ msgstr "Utenti e gruppi" #. Default: "Using this form, you can manage alternative urls for an item. This is an easy way to make an item available under two different URLs." #: components/manage/Aliases/Aliases msgid "Using this form, you can manage alternative urls for an item. This is an easy way to make an item available under two different URLs." -msgstr "Utilizzando questo modulo, è possibile gestire url alternativi per gli elementi per rendere un elemento disponibile sotto due diversi indirizzi in modo facile." +msgstr "Utilizzando questo modulo, è possibile creare URL alternativi per i contenuti in modo da renderli disponibili con due diversi indirizzi URL. Digitando su browser l'URL alternativo creato per un contenuto verrà fatto un redirect all'URL originale del contenuto stesso." #. Default: "Variation" #: helpers/Extensions/withBlockSchemaEnhancer @@ -4235,7 +4251,7 @@ msgid "View changes" msgstr "Mostra le modifiche" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "Visualizza i collegamenti e i riferimenti a questo elemento" @@ -4475,7 +4491,7 @@ msgstr "Viste disponibili" #. Default: "Error in the block field {errorField}." #: helpers/MessageLabels/MessageLabels msgid "blocksFieldsErrorTitle" -msgstr "" +msgstr "Errore nel campo {errorField} del blocco." #. Default: "Forgot your password?" #: components/theme/Login/Login @@ -4486,7 +4502,7 @@ msgstr "Hai dimenticato la tua password?" #. Default: "Add many alternative URLs at once by uploading a CSV file. The first column should be the path to redirect from; the second, the path to redirect to. Both paths must be Plone-site-relative, starting with a slash (/). An optional third column can contain a date and time. An optional fourth column can contain a boolean to mark as a manual redirect (default true)." #: components/manage/Controlpanels/Aliases msgid "bulkUploadUrlsHelp" -msgstr "" +msgstr "Aggiungi molte URLs alternative contemporaneamente caricando un file CSV. La prima colonna deve contenere il percorso da cui reindirizzare (sorgente); la seconda colonna, il path a cui reindirizzare (destinazione). Entrambi i percorsi devono essere url relativi, e quindi devono iniziare con lo slash (/). Una terza colonna opzionale può contenere data e ora. Una quarta colonna opzionale può contenere un valore booleano (true/false) per poter contrassegnare come reindirizzamento manuale (predefinito: true)" #. Default: "Checkbox" #: config/Blocks @@ -4516,7 +4532,7 @@ msgstr "Confronta con" #. Default: "{countofrelation} broken {countofrelation, plural, one {relation} other {relations}} of type {typeofrelation}" #: components/manage/Controlpanels/Relations/BrokenRelations msgid "countBrokenRelations" -msgstr "" +msgstr "{countofrelation} {countofrelation, plural, one {relazione rotta} other {relazioni rotte}} di tipo {typeofrelation}" #. Default: "Date Range" #: config/Blocks @@ -4664,12 +4680,12 @@ msgid "intranet" msgstr "Pubblicato internamente" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "elemento" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "elementi" @@ -4688,6 +4704,21 @@ msgstr "Il mio nome utente è" msgid "leadimage" msgstr "Immagine di testata" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "Elimina" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "Elimina questo elemento e rompi i collegamenti" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "Sto verificando i riferimenti a questo contenuto..." + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4813,15 +4844,20 @@ msgid "rebuild relations" msgstr "ricrea le relazioni" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "riferimento" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "riferimenti" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "fa riferimento a" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index c6ba730668..6d51320e2d 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -558,6 +558,7 @@ msgstr "ふるまいのブロックが有効で、かつ{type}-contenttype o #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1057,12 +1058,12 @@ msgid "Delete row" msgstr "Rij verwijderen" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "Geselecteerde items verwijderen?" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "Dit item verwijderen?" @@ -1072,7 +1073,7 @@ msgid "Deleted" msgstr "Verwijderd" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "Dit item verwijderen breekt {brokenReferences} {variation}." @@ -2357,6 +2358,11 @@ msgstr "Smal" msgid "Navigate back" msgstr "Navigeer terug" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3239,6 +3245,11 @@ msgstr "Selecteer de te tonen kolommen" msgid "Select relation" msgstr "Selecteer relatie" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3436,12 +3447,12 @@ msgid "Small" msgstr "Klein" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "Bepaalde items zijn ook een map. Door het verwijderen ervan, verwijder je tevens {containedItemsToDelete} {variation} in de mappen." #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "Bepaalde items worden gerefereerd door andere inhoud. Door het verwijderen ervan, worden {brokenReferences} {variation} gebroken." @@ -3809,6 +3820,11 @@ msgstr "Er zijn fouten opgetreden" msgid "There were some errors." msgstr "Er zijn fouten opgetreden." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3830,7 +3846,7 @@ msgid "This is a working copy of {title}" msgstr "Dit is een werkkopij van {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "Dit item is ook een map. Door deze te verwijderen, verwijder je eveneens {containedItemsToDelete} {variation} in de map." @@ -4239,7 +4255,7 @@ msgid "View changes" msgstr "Bekijk wijzigingen" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "Bekijk koppelingen en referenties naar dit item" @@ -4668,12 +4684,12 @@ msgid "intranet" msgstr "Intranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "item" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "items" @@ -4692,6 +4708,21 @@ msgstr "Mijn gebruikersnaam is" msgid "leadimage" msgstr "Veld leidende afbeelding" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4817,15 +4848,20 @@ msgid "rebuild relations" msgstr "hetbouw relaties" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "referentie" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "referenties" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index 075a03f3d3..61736fb8a3 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -558,6 +558,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1058,12 +1059,12 @@ msgid "Delete row" msgstr "Eliminar linha" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1073,7 +1074,7 @@ msgid "Deleted" msgstr "" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2358,6 +2359,11 @@ msgstr "" msgid "Navigate back" msgstr "" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3240,6 +3246,11 @@ msgstr "Seleccione colunas a apresentar" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3437,12 +3448,12 @@ msgid "Small" msgstr "" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3810,6 +3821,11 @@ msgstr "" msgid "There were some errors." msgstr "Ocorreram alguns erros." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3831,7 +3847,7 @@ msgid "This is a working copy of {title}" msgstr "" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4240,7 +4256,7 @@ msgid "View changes" msgstr "Ver modificações" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4669,12 +4685,12 @@ msgid "intranet" msgstr "" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4693,6 +4709,21 @@ msgstr "Meu nome de usuário é" msgid "leadimage" msgstr "" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4818,15 +4849,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 8ec0da515b..aa504377c5 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -559,6 +559,7 @@ msgstr "Não é possível editar layout para o tipo de conteúdo {type}< #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1059,12 +1060,12 @@ msgid "Delete row" msgstr "Excluir linha" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "Excluir os itens selecionados?" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "Apagar este item?" @@ -1074,7 +1075,7 @@ msgid "Deleted" msgstr "Removida" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "A exclusão desse item quebra {brokenReferences} {variation}." @@ -2359,6 +2360,11 @@ msgstr "Estreito" msgid "Navigate back" msgstr "Voltar" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3241,6 +3247,11 @@ msgstr "Selecione colunas para mostrar" msgid "Select relation" msgstr "Selecione um relacionamento" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3438,12 +3449,12 @@ msgid "Small" msgstr "Pequeno" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "Alguns itens também são uma pasta. Ao excluí-los, você excluirá {containedItemsToDelete} {variation} dentro destas pastas." #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "Alguns itens são referenciados por outros conteúdos. Ao excluí-los, {brokenReferences} {variation} podem ser quebrados." @@ -3811,6 +3822,11 @@ msgstr "Houve alguns erros" msgid "There were some errors." msgstr "Houve alguns erros." +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3832,7 +3848,7 @@ msgid "This is a working copy of {title}" msgstr "Esta é uma cópia de trabalho de {title}" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "Esse item também é uma pasta. Ao excluí-lo, você excluirá {containedItemsToDelete} {variation} dentro da pasta." @@ -4241,7 +4257,7 @@ msgid "View changes" msgstr "Ver mudanças" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "Exibir links e referências a este item" @@ -4670,12 +4686,12 @@ msgid "intranet" msgstr "Intranet" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "Item" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "Itens" @@ -4694,6 +4710,21 @@ msgstr "Meu nome de usuário é " msgid "leadimage" msgstr "Imagem principal" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4819,15 +4850,20 @@ msgid "rebuild relations" msgstr "reconstruir relacionamentos" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "referência" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "referências" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 1cbec413e0..58314bb461 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -559,6 +559,7 @@ msgstr "Nu se poate edita aspectul pentru tipul de conținut {type}\n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -555,6 +555,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1055,12 +1056,12 @@ msgid "Delete row" msgstr "" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1070,7 +1071,7 @@ msgid "Deleted" msgstr "" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2355,6 +2356,11 @@ msgstr "" msgid "Navigate back" msgstr "" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3237,6 +3243,11 @@ msgstr "" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3434,12 +3445,12 @@ msgid "Small" msgstr "" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3807,6 +3818,11 @@ msgstr "" msgid "There were some errors." msgstr "" +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3828,7 +3844,7 @@ msgid "This is a working copy of {title}" msgstr "" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4237,7 +4253,7 @@ msgid "View changes" msgstr "" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4666,12 +4682,12 @@ msgid "intranet" msgstr "" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4690,6 +4706,21 @@ msgstr "" msgid "leadimage" msgstr "" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4815,15 +4846,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index e1948dea26..0b08345f61 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -559,6 +559,7 @@ msgstr "" #. Default: "Cancel" #: components/manage/Add/Add +#: components/manage/Contents/ContentsDeleteModal #: components/manage/Contents/ContentsUploadModal #: components/manage/Controlpanels/ContentType #: components/manage/Controlpanels/ContentTypeLayout @@ -1059,12 +1060,12 @@ msgid "Delete row" msgstr "删除条件" #. Default: "Delete selected items?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete selected items?" msgstr "" #. Default: "Delete this item?" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Delete this item?" msgstr "" @@ -1074,7 +1075,7 @@ msgid "Deleted" msgstr "已删除" #. Default: "Deleting this item breaks {brokenReferences} {variation}." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Deleting this item breaks {brokenReferences} {variation}." msgstr "" @@ -2359,6 +2360,11 @@ msgstr "" msgid "Navigate back" msgstr "导航返回" +#. Default: "Navigate to this item" +#: components/manage/Contents/ContentsDeleteModal +msgid "Navigate to this item" +msgstr "" + #. Default: "Navigation" #: components/theme/Navigation/ContextNavigation msgid "Navigation" @@ -3241,6 +3247,11 @@ msgstr "选择要显示的列" msgid "Select relation" msgstr "" +#. Default: "Select rule" +#: components/manage/Rules/Rules +msgid "Select rule" +msgstr "" + #. Default: "Select the transition to be used for modifying the items state." #: components/manage/Contents/ContentsWorkflowModal msgid "Select the transition to be used for modifying the items state." @@ -3438,12 +3449,12 @@ msgid "Small" msgstr "小" #. Default: "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are also a folder. By deleting them you will delete {containedItemsToDelete} {variation} inside the folders." msgstr "" #. Default: "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "Some items are referenced by other contents. By deleting them {brokenReferences} {variation} will be broken." msgstr "" @@ -3811,6 +3822,11 @@ msgstr "这里出现了一些错误" msgid "There were some errors." msgstr "这里出现了一些错误。" +#. Default: "These items will have broken links" +#: components/manage/Contents/ContentsDeleteModal +msgid "These items will have broken links" +msgstr "" + #. Default: "Third" #: components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField msgid "Third" @@ -3832,7 +3848,7 @@ msgid "This is a working copy of {title}" msgstr "这是{title}的一个工作副本" #. Default: "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "This item is also a folder. By deleting it you will delete {containedItemsToDelete} {variation} inside the folder." msgstr "" @@ -4241,7 +4257,7 @@ msgid "View changes" msgstr "" #. Default: "View links and references to this item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "View links and references to this item" msgstr "" @@ -4670,12 +4686,12 @@ msgid "intranet" msgstr "内部" #. Default: "item" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "item" msgstr "" #. Default: "items" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "items" msgstr "" @@ -4694,6 +4710,21 @@ msgstr "我的用户名是" msgid "leadimage" msgstr "" +#. Default: "Delete" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete" +msgstr "" + +#. Default: "Delete item and break links" +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: Delete item and break links" +msgstr "" + +#. Default: "Checking references..." +#: components/manage/Contents/ContentsDeleteModal +msgid "link-integrity: loading references" +msgstr "" + #. Default: "Enter a URL to an image" #: components/manage/Widgets/ImageWidget msgid "linkAnImage" @@ -4819,15 +4850,20 @@ msgid "rebuild relations" msgstr "" #. Default: "reference" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "reference" msgstr "" #. Default: "references" -#: components/manage/Contents/Contents +#: components/manage/Contents/ContentsDeleteModal msgid "references" msgstr "" +#. Default: "refers to" +#: components/manage/Contents/ContentsDeleteModal +msgid "refers to" +msgstr "" + #. Default: "results" #: components/theme/Search/Search msgid "results found" diff --git a/packages/volto/news/6534.internal b/packages/volto/news/6534.internal new file mode 100644 index 0000000000..3aea67dbc9 --- /dev/null +++ b/packages/volto/news/6534.internal @@ -0,0 +1 @@ +Fixed and re-enabled the types declaration extractor from core Volto. @sneridagh diff --git a/packages/volto/package.json b/packages/volto/package.json index dbca426284..64d9b1c45b 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "18.1.2", + "version": "18.3.0", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" 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..60a2c5c952 100644 --- a/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +++ b/packages/volto/src/components/manage/Blocks/Container/EditBlockWrapper.jsx @@ -1,10 +1,10 @@ -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 { buildStyleObjectFromData } from '@plone/volto/helpers/Blocks/Blocks'; import clearSVG from '@plone/volto/icons/clear.svg'; const messages = defineMessages({ @@ -38,12 +38,15 @@ const EditBlockWrapper = (props) => { onChangeBlock(block, { '@type': 'empty' }); } + const style = buildStyleObjectFromData(data); + return (
{ 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..cf51a250fa 100644 --- a/packages/volto/src/components/manage/Contents/Contents.jsx +++ b/packages/volto/src/components/manage/Contents/Contents.jsx @@ -11,7 +11,6 @@ import { createPortal } from 'react-dom'; import { Link } from 'react-router-dom'; import { Button, - Confirm, Container as SemanticContainer, Divider, Dropdown, @@ -22,54 +21,52 @@ 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 { 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'; import { ContentsRenameModal } from '@plone/volto/components/manage/Contents'; import ContentsUploadModal from '@plone/volto/components/manage/Contents/ContentsUploadModal'; +import ContentsDeleteModal from '@plone/volto/components/manage/Contents/ContentsDeleteModal'; import ContentsWorkflowModal from '@plone/volto/components/manage/Contents/ContentsWorkflowModal'; import ContentsTagsModal from '@plone/volto/components/manage/Contents/ContentsTagsModal'; import ContentsPropertiesModal from '@plone/volto/components/manage/Contents/ContentsPropertiesModal'; -import { Helmet, getBaseUrl } from '@plone/volto/helpers'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable'; import config from '@plone/volto/registry'; @@ -119,14 +116,6 @@ const messages = defineMessages({ id: 'Delete', defaultMessage: 'Delete', }, - deleteConfirmSingleItem: { - id: 'Delete this item?', - defaultMessage: 'Delete this item?', - }, - deleteConfirmMultipleItems: { - id: 'Delete selected items?', - defaultMessage: 'Delete selected items?', - }, deleteError: { id: 'The item could not be deleted.', defaultMessage: 'The item could not be deleted.', @@ -300,7 +289,6 @@ class Contents extends Component { orderContent: PropTypes.func.isRequired, sortContent: PropTypes.func.isRequired, updateColumnsContent: PropTypes.func.isRequired, - linkIntegrityCheck: PropTypes.func.isRequired, clipboardRequest: PropTypes.shape({ loading: PropTypes.bool, loaded: PropTypes.bool, @@ -399,7 +387,6 @@ class Contents extends Component { this.paste = this.paste.bind(this); this.fetchContents = this.fetchContents.bind(this); this.orderTimeout = null; - this.deleteItemsToShowThreshold = 10; this.state = { selected: [], @@ -410,10 +397,6 @@ class Contents extends Component { showProperties: false, showWorkflow: false, itemsToDelete: [], - containedItemsToDelete: [], - brokenReferences: 0, - breaches: [], - showAllItemsToDelete: true, items: this.props.items, filter: '', currentPage: 0, @@ -429,7 +412,6 @@ class Contents extends Component { sort_on: this.props.sort?.on || 'getObjPositionInParent', sort_order: this.props.sort?.order || 'ascending', isClient: false, - linkIntegrityBreakages: [], }; this.filterTimeout = null; } @@ -443,50 +425,6 @@ class Contents extends Component { this.fetchContents(); this.setState({ isClient: true }); } - async componentDidUpdate(_, prevState) { - if ( - this.state.itemsToDelete !== prevState.itemsToDelete && - this.state.itemsToDelete.length > 0 - ) { - const linkintegrityInfo = await this.props.linkIntegrityCheck( - map(this.state.itemsToDelete, (item) => this.getFieldById(item, 'UID')), - ); - const containedItems = linkintegrityInfo - .map((result) => result.items_total ?? 0) - .reduce((acc, value) => acc + value, 0); - const breaches = linkintegrityInfo.flatMap((result) => - result.breaches.map((source) => ({ - source: source, - target: result, - })), - ); - const source_by_uid = breaches.reduce( - (acc, value) => acc.set(value.source.uid, value.source), - new Map(), - ); - const by_source = breaches.reduce((acc, value) => { - if (acc.get(value.source.uid) === undefined) { - acc.set(value.source.uid, new Set()); - } - acc.get(value.source.uid).add(value.target); - return acc; - }, new Map()); - - this.setState({ - containedItemsToDelete: containedItems, - brokenReferences: by_source.size, - linksAndReferencesViewLink: linkintegrityInfo.length - ? linkintegrityInfo[0]['@id'] + '/links-to-item' - : null, - breaches: Array.from(by_source, (entry) => ({ - source: source_by_uid.get(entry[0]), - targets: Array.from(entry[1]), - })), - showAllItemsToDelete: - this.state.itemsToDelete.length < this.deleteItemsToShowThreshold, - }); - } - } /** * Component will receive props @@ -1211,298 +1149,12 @@ class Contents extends Component { />
- - {this.state.itemsToDelete.length > 1 ? ( - this.state.containedItemsToDelete > 0 ? ( - <> - - {this.state.containedItemsToDelete} - - ), - variation: ( - - {this.state.containedItemsToDelete === - 1 ? ( - - ) : ( - - )} - - ), - }} - /> - {this.state.brokenReferences > 0 && ( - <> -
- - {this.state.brokenReferences} - - ), - variation: ( - - {this.state.brokenReferences === 1 ? ( - - ) : ( - - )} - - ), - }} - /> - - )} - - ) : ( - <> - {this.state.brokenReferences > 0 && ( - <> - - {this.state.brokenReferences} - - ), - variation: ( - - {this.state.brokenReferences === 1 ? ( - - ) : ( - - )} - - ), - }} - /> - - )} - - ) - ) : this.state.containedItemsToDelete > 0 ? ( - <> - - {this.state.containedItemsToDelete} - - ), - variation: ( - - {this.state.containedItemsToDelete === 1 ? ( - - ) : ( - - )} - - ), - }} - /> - {this.state.brokenReferences > 0 && ( - <> -
- {this.state.brokenReferences} - ), - variation: ( - - {this.state.brokenReferences === 1 ? ( - - ) : ( - - )} - - ), - }} - /> -
- -
    - {this.state.breaches.map((breach) => ( -
  • - - {breach.source.title} - {' '} - refers to{' '} - {breach.targets - .map((target) => ( - - {target.title} - - )) - .reduce((result, item) => ( - <> - {result}, {item} - - ))} -
  • - ))} -
- {this.state.linksAndReferencesViewLink && ( - - - - )} -
- - )} - - ) : this.state.brokenReferences > 0 ? ( - <> - {this.state.brokenReferences} - ), - variation: ( - - {this.state.brokenReferences === 1 ? ( - - ) : ( - - )} - - ), - }} - /> -
- -
    - {this.state.breaches.map((breach) => ( -
  • - - {breach.source.title} - {' '} - refers to{' '} - {breach.targets - .map((target) => ( - - {target.title} - - )) - .reduce((result, item) => ( - <> - {result}, {item} - - ))} -
  • - ))} -
- {this.state.linksAndReferencesViewLink && ( - - - - )} -
- - ) : null} -
- } onCancel={this.onDeleteCancel} - onConfirm={this.onDeleteOk} - size="medium" + onOk={this.onDeleteOk} + items={this.state.items} + itemsToDelete={this.state.itemsToDelete} /> { + const { itemsToDelete = [], open, onCancel, onOk, items } = props; + const intl = useIntl(); + const dispatch = useDispatch(); + const linkintegrityInfo = useSelector((state) => state.linkIntegrity?.result); + const loading = useSelector((state) => state.linkIntegrity?.loading); + + const [brokenReferences, setBrokenReferences] = useState(0); + const [containedItemsToDelete, setContainedItemsToDelete] = useState([]); + const [breaches, setBreaches] = useState([]); + + const [linksAndReferencesViewLink, setLinkAndReferencesViewLink] = + useState(null); + + useEffect(() => { + const getFieldById = (id, field) => { + const item = find(items, { '@id': id }); + return item ? item[field] : ''; + }; + + if (itemsToDelete.length > 0 && open) { + dispatch( + linkIntegrityCheck( + map(itemsToDelete, (item) => getFieldById(item, 'UID')), + ), + ); + } + }, [itemsToDelete, items, open, dispatch]); + + useEffect(() => { + if (linkintegrityInfo) { + const containedItems = linkintegrityInfo + .map((result) => result.items_total ?? 0) + .reduce((acc, value) => acc + value, 0); + const breaches = linkintegrityInfo.flatMap((result) => + result.breaches.map((source) => ({ + source: source, + target: result, + })), + ); + const source_by_uid = breaches.reduce( + (acc, value) => acc.set(value.source.uid, value.source), + new Map(), + ); + const by_source = breaches.reduce((acc, value) => { + if (acc.get(value.source.uid) === undefined) { + acc.set(value.source.uid, new Set()); + } + acc.get(value.source.uid).add(value.target); + return acc; + }, new Map()); + + setContainedItemsToDelete(containedItems); + setBrokenReferences(by_source.size); + setLinkAndReferencesViewLink( + linkintegrityInfo.length + ? linkintegrityInfo[0]['@id'] + '/links-to-item' + : null, + ); + setBreaches( + Array.from(by_source, (entry) => ({ + source: source_by_uid.get(entry[0]), + targets: Array.from(entry[1]), + })), + ); + } else { + setContainedItemsToDelete([]); + setBrokenReferences(0); + setLinkAndReferencesViewLink(null); + setBreaches([]); + } + }, [linkintegrityInfo]); + + return ( + open && ( + + + + {intl.formatMessage(messages.loading)} + + + + {itemsToDelete.length > 1 ? ( + containedItemsToDelete > 0 ? ( + <> + {containedItemsToDelete} + ), + variation: ( + + {containedItemsToDelete === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + {brokenReferences > 0 && ( + <> +
+ {brokenReferences}, + variation: ( + + {brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + + )} + + ) : ( + <> + {brokenReferences > 0 && ( + <> + {brokenReferences}, + variation: ( + + {brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + + )} + + ) + ) : containedItemsToDelete > 0 ? ( + <> + {containedItemsToDelete} + ), + variation: ( + + {containedItemsToDelete === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + {brokenReferences > 0 && ( + <> +
+ {brokenReferences}, + variation: ( + + {brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + + + )} + + ) : brokenReferences > 0 ? ( + <> + {brokenReferences}, + variation: ( + + {brokenReferences === 1 ? ( + + ) : ( + + )} + + ), + }} + /> + + + ) : null} +
+ } + onCancel={onCancel} + onConfirm={onOk} + size="medium" + /> + ) + ); +}; + +const BrokenLinksList = ({ intl, breaches, linksAndReferencesViewLink }) => { + return ( +
+ + : + + + {breaches.map((breach) => ( + + + + {breach.source.title} + + + + : + + +
    + {breach.targets.map((target) => ( +
  • + + {target.title} + +
  • + ))} +
+
+
+ ))} +
+
+ {linksAndReferencesViewLink && ( + + + + )} +
+ ); +}; +ContentsDeleteModal.propTypes = { + itemsToDelete: PropTypes.arrayOf( + PropTypes.shape({ + UID: PropTypes.string, + }), + ).isRequired, + open: PropTypes.bool.isRequired, + onOk: PropTypes.func.isRequired, + onCancel: PropTypes.func.isRequired, +}; +export default ContentsDeleteModal; 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/Pluggable.stories.js b/packages/volto/src/components/manage/Pluggable/Pluggable.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/Pluggable/Pluggable.stories.js rename to packages/volto/src/components/manage/Pluggable/Pluggable.stories.jsx diff --git a/packages/volto/src/components/manage/Pluggable/Pluggable.test.js b/packages/volto/src/components/manage/Pluggable/Pluggable.test.jsx similarity index 100% rename from packages/volto/src/components/manage/Pluggable/Pluggable.test.js rename to packages/volto/src/components/manage/Pluggable/Pluggable.test.jsx diff --git a/packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.js.snap b/packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.jsx.snap similarity index 100% rename from packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.js.snap rename to packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.jsx.snap diff --git a/packages/volto/src/components/manage/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..2a07bf0ca6 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: { @@ -75,6 +76,10 @@ const messages = defineMessages({ id: 'Unassigned', defaultMessage: 'Unassigned', }, + select_rule: { + id: 'Select rule', + defaultMessage: 'Select rule', + }, }); /** @@ -365,7 +370,9 @@ class Rules extends Component { />