Skip to content

Commit

Permalink
Merge branch 'main' into slots-base
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Dec 11, 2024
2 parents e1aea1a + 08893ab commit 5682b38
Show file tree
Hide file tree
Showing 79 changed files with 150 additions and 81 deletions.
45 changes: 33 additions & 12 deletions PACKAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
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.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
Expand Down
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.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
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.2",
"version": "18.0.3",
"description": "Slate.js integration with Volto",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
1 change: 1 addition & 0 deletions packages/volto/.eslintrc.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (process.env.VOLTOCONFIG) {
rules = null;
} else {
rules = {
'react/jsx-filename-extension': ['warn', { extensions: ['.tsx', '.jsx'] }],
'no-restricted-imports': [
'warn',
{
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/.release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"../scripts/prepublish.js": {}
},
"hooks": {
"before:bump": ["pnpm i18n", "pnpm build:types", "git add types"],
"before:bump": ["pnpm i18n"],
"after:bump": [
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
"pipx run towncrier build --yes --version ${version}",
Expand Down
23 changes: 23 additions & 0 deletions packages/volto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ myst:

<!-- towncrier release notes start -->

## 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
Expand Down
1 change: 1 addition & 0 deletions packages/volto/news/6523.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable initial scroll to top after SSR completion. @Faakhir30
2 changes: 1 addition & 1 deletion packages/volto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"license": "MIT",
"version": "18.2.0",
"version": "18.2.3",
"repository": {
"type": "git",
"url": "[email protected]:plone/volto.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Recurrence,
} from '@plone/volto/components/theme/View/EventDatesInfo';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import { expandToBackendURL } from '@plone/volto/helpers/Url/Url';
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';

import calendarSVG from '@plone/volto/icons/calendar.svg';

Expand Down Expand Up @@ -147,7 +147,7 @@ const EventDetails = ({ content, display_as = 'aside' }) => {
className="ics-download"
target="_blank"
rel="noreferrer"
href={`${expandToBackendURL(content['@id'])}/ics_view`}
href={`${flattenToAppURL(content['@id'])}/ics_view`}
>
{intl.formatMessage(messages.downloadEvent)}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ exports[`renders event details component with all props 1`] = `
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -169,7 +169,7 @@ exports[`renders event details component with only required props 1`] = `
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -211,7 +211,7 @@ exports[`renders event details component without links to api in the text 1`] =
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ exports[`renders an event view component with all props 1`] = `
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -357,7 +357,7 @@ exports[`renders an event view component with only required props 1`] = `
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -458,7 +458,7 @@ exports[`renders an event view component without links to api in the text 1`] =
/>
<a
className="ics-download"
href="http://localhost:8080/Plone/++api++/my-page/ics_view"
href="/my-page/ics_view"
rel="noreferrer"
target="_blank"
>
Expand Down
9 changes: 9 additions & 0 deletions packages/volto/src/config/Blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,15 @@ const requiredBlocks = ['title'];
const initialBlocks = {};
const initialBlocksFocus = {}; //{Document:'title'}

export function installDefaultBlocks(config) {
config.blocks.requiredBlocks = requiredBlocks;
config.blocks.blocksConfig = blocksConfig;
config.blocks.groupBlocksOrder = groupBlocksOrder;
config.blocks.initialBlocks = initialBlocks;
config.blocks.initialBlocksFocus = initialBlocksFocus;
config.blocks.showEditBlocksInBabelView = false;
}

export {
groupBlocksOrder,
requiredBlocks,
Expand Down
15 changes: 9 additions & 6 deletions packages/volto/src/config/Components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import App from '@plone/volto/components/theme/App/App';
import PreviewImage from '@plone/volto/components/theme/PreviewImage/PreviewImage';
import Image from '@plone/volto/components/theme/Image/Image';

// Register components.
export const components = {
PreviewImage: { component: PreviewImage },
App: { component: App },
Image: { component: Image },
};
export function installDefaultComponents(config) {
config.components = {
PreviewImage: { component: PreviewImage },
App: { component: App },
Image: { component: Image },
};

return config;
}
10 changes: 10 additions & 0 deletions packages/volto/src/config/Views.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,13 @@ export const layoutViewsNamesMapping = {
view: 'Default view',
default: 'Default view',
};

export function installDefaultViews(config) {
config.views.layoutViews = layoutViews;
config.views.contentTypesViews = contentTypesViews;
config.views.defaultView = defaultView;
config.views.errorViews = errorViews;
config.views.layoutViewsNamesMapping = layoutViewsNamesMapping;

return config;
}
5 changes: 5 additions & 0 deletions packages/volto/src/config/Widgets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,8 @@ export const widgetMapping = {

// Default Widget
export const defaultWidget = TextWidget;

export function installDefaultWidgets(config) {
config.widgets = widgetMapping;
config.widgets.default = defaultWidget;
}
Loading

0 comments on commit 5682b38

Please sign in to comment.