Skip to content

Commit

Permalink
Merge branch 'main' into erral-registration-form-with-userschema
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Dec 8, 2024
2 parents 24d9f2e + da44965 commit db80cab
Show file tree
Hide file tree
Showing 368 changed files with 1,629 additions and 1,083 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ packages/volto-guillotina
dist
packages/registry/lib
packages/registry/docs
apps/rr7/.react-router
23 changes: 23 additions & 0 deletions docs/source/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ myst:

<!-- towncrier release notes start -->

## 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

- Remove `not ie 11` from browserslist configuration, because it is now included in `not dead`. @stevepiercy [#6501](https://github.com/plone/volto/issues/6501)
- Fix warnings related to `snapshot.managedPaths` on startup. @davisagli [#6511](https://github.com/plone/volto/issues/6511)

### Internal

- Add Accessibility acceptance tests for content types. @ana-oprea @ichim-david [#6339](https://github.com/plone/volto/issues/6339)
- Fixed the `README.md` for Volto core when releasing to npm registry: copy it from the root of the monorepo on release. @sneridagh [#6510](https://github.com/plone/volto/issues/6510)

### Documentation

- Add new Volto trainings to tutorials. @stevepiercy [#6499](https://github.com/plone/volto/issues/6499)
- `html_use_opensearch` value must not have a trailing slash. Clean up comments. @stevepiercy [#6502](https://github.com/plone/volto/issues/6502)

## 18.1.1 (2024-11-21)

### Bugfix
Expand Down
9 changes: 8 additions & 1 deletion docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,18 @@ Modern bundlers, such as Vite, rely upon the import path to determine whether to

The barrel imports must be removed to increase the natural number of chunks that Volto divides on—especially on routes—resulting in code splitting done the right and natural way.
This forces us to rewrite all the imports everywhere—including core, projects, and add-ons—once we implement it.
The barrel imports files include the following.
The barrel imports files include the following in Volto.

- {file}`src/components/index.js`
- {file}`src/helpers/index.js`
- {file}`src/actions/index.js`
- {file}`src/hooks/index.js`

They also include the following in the `@plone/volto-slate` package.

- {file}`src/actions/index.js`
- {file}`src/editor/ui/index.js`
- {file}`src/utils/index.js`

##### Alternative

Expand Down
6 changes: 6 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<!-- towncrier release notes start -->

## 2.2.1 (2024-12-05)

### Bugfix

- Fix color picker usability. @sneridagh [#6512](https://github.com/plone/volto/issues/6512)

## 2.2.0 (2024-11-21)

### Feature
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"license": "MIT",
"version": "2.2.0",
"version": "2.2.1",
"repository": {
"type": "git",
"url": "http://github.com/plone/components.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ const meta = {
tags: ['autodocs'],
} satisfies Meta<typeof ColorPicker>;

const ColorPickerStory = (args: any) => {
const [color, setColor] = React.useState(args.defaultValue);

return (
<>
<ColorPicker {...args} value={color} onChange={setColor} />
The color is: {color.toString('hex')}
</>
);
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
render: (args: any) => <ColorPicker {...args} />,
render: ColorPickerStory,
};

Default.args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ export function ColorPicker({ label, children, ...props }: ColorPickerProps) {
yChannel="brightness"
/>
<ColorSlider colorSpace="hsb" channel="hue" />
<ColorField label="Hex" />
<ColorField
label="Hex"
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.currentTarget.blur();
}
}}
/>
</>
)}
</Dialog>
Expand Down
4 changes: 2 additions & 2 deletions packages/coresandbox/src/components/Blocks/FormBlock/Edit.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SidebarPortal } from '@plone/volto/components';
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
import Data from './Data';
import type { BlockEditProps } from '@plone/types';
import { Helmet } from '@plone/volto/helpers';
import { Helmet } from '@plone/volto/helpers/Helmet/Helmet';

import { defineMessages, useIntl } from 'react-intl';
import { Container } from 'semantic-ui-react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect } from 'react';
import { SidebarPortal } from '@plone/volto/components';
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
import Data from './Data';
import type { BlockEditProps } from '@plone/types';
import { Input, Button } from 'semantic-ui-react';
import { Icon } from '@plone/volto/components';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import aheadSVG from '@plone/volto/icons/ahead.svg';

const InputBlockEdit = (props: BlockEditProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SidebarPortal } from '@plone/volto/components';
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';
import Data from './Data';
import type { BlockEditProps } from '@plone/types';

Expand Down
2 changes: 1 addition & 1 deletion packages/coresandbox/src/components/TestForm.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Helmet } from '@plone/volto/helpers';
import { Helmet } from '@plone/volto/helpers/Helmet/Helmet';

import { defineMessages, useIntl } from 'react-intl';
import { Container } from 'semantic-ui-react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import { searchContent } from '@plone/volto/actions';
import { searchContent } from '@plone/volto/actions/search/search';
import { useDispatch, useSelector } from 'react-redux';
import { Container } from 'semantic-ui-react';

Expand Down
6 changes: 3 additions & 3 deletions packages/coresandbox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TestBlockView from './components/Blocks/TestBlock/View';
import TestBlockEdit from './components/Blocks/TestBlock/Edit';
import InputBlockView from './components/Blocks/InputBlock/View';
import InputBlockEdit from './components/Blocks/InputBlock/Edit';
import { flattenToAppURL } from '@plone/volto/helpers';
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
import { SliderSchema as TestBlockSchema } from './components/Blocks/TestBlock/schema';
import { inputBlockSchema } from './components/Blocks/InputBlock/schema';
import { multipleFieldsetsSchema } from './components/Blocks/TestBlock/schema';
Expand All @@ -13,13 +13,13 @@ import codeSVG from '@plone/volto/icons/code.svg';
import type { BlockConfigBase } from '@plone/types';
import type { ConfigType } from '@plone/registry';
import SlotComponentTest from './components/Slots/SlotTest';
import { ContentTypeCondition } from '@plone/volto/helpers';
import { ContentTypeCondition } from '@plone/volto/helpers/Slots';
import { RouteCondition } from '@plone/volto/helpers/Slots';
import TestForm from './components/TestForm';
import FormBlockView from './components/Blocks/FormBlock/View';
import FormBlockEdit from './components/Blocks/FormBlock/Edit';
import { formBlockSchema } from './components/Blocks/FormBlock/schema';
import { Login } from '@plone/volto/components';
import Login from '@plone/volto/components/theme/Login/Login';

const testBlock: BlockConfigBase = {
id: 'testBlock',
Expand Down
7 changes: 7 additions & 0 deletions packages/volto-slate/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ module.exports = {
rules: {
'import/no-unresolved': 0,
},
settings: {
'import/resolver': {
alias: {
map: [['@plone/volto-slate', './src']],
},
},
},
};
6 changes: 6 additions & 0 deletions packages/volto-slate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<!-- towncrier release notes start -->

## 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
Expand Down
2 changes: 1 addition & 1 deletion packages/volto-slate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plone/volto-slate",
"version": "18.0.1",
"version": "18.0.2",
"description": "Slate.js integration with Volto",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/volto-slate/src/actions/content.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion packages/volto-slate/src/blocks/Table/TableBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 6 additions & 8 deletions packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
7 changes: 4 additions & 3 deletions packages/volto-slate/src/blocks/Text/SlashMenu.jsx
Original file line number Diff line number Diff line change
@@ -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: [
Expand Down
6 changes: 2 additions & 4 deletions packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions packages/volto-slate/src/blocks/Text/TextBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 6 additions & 8 deletions packages/volto-slate/src/blocks/Text/extensions/breakList.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
11 changes: 4 additions & 7 deletions packages/volto-slate/src/blocks/Text/extensions/insertBreak.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion packages/volto-slate/src/blocks/Text/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Loading

0 comments on commit db80cab

Please sign in to comment.