Skip to content

Commit

Permalink
Merge branch 'main' into betterproviders
Browse files Browse the repository at this point in the history
* main: (31 commits)
  Release 18.0.0-alpha.35
  Release @plone/types 1.0.0-alpha.16
  (fix): export getFieldURL from Url.js in helpers (#6100)
  Improve container detection, `config.settings.containerBlockTypes` is no longer needed (#6099)
  Support nested directories in public folder add-on sync folders both … (#6098)
  Release 18.0.0-alpha.34
  Add generated new declarations for a34, just in case (#6097)
  Release @plone/slate 18.0.0-alpha.13
  Release @plone/registry 1.6.0
  Release @plone/types 1.0.0-alpha.15
  Add support for reading the add-ons `tsconfig.json` paths (#6096)
  Fixes #6046 pass proper defaults to align and size fields of Image block (#6093)
  bug fix. relations control panel. Restrict eglible relation targets a… (#6092)
  Fix Uncaught RangeError: date value is not finite in DateTimeFormat.format (#6088)
  Add optional `token` parameter to ploneClient initialization (#6077)
  Blocks Layout Navigator (#5642)
  Fix internalUrl  Widget to Reflect Prop Changes via onChangeBlock (#6036)
  [types] Improve styleClassNameExtenders types, Icon component JSDoc t… (#6095)
  Fix link in pop-up RelationsMatrix.jsx (#6085)
  Fix deselecting lists. (#6080)
  ...
  • Loading branch information
sneridagh committed Jun 17, 2024
2 parents a6c2c68 + b629e5a commit 02ec9a6
Show file tree
Hide file tree
Showing 130 changed files with 2,931 additions and 596 deletions.
1 change: 1 addition & 0 deletions docs/source/addons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ myst:
i18n
best-practices
theme
public-folder
```

There are several advanced scenarios where we might want to have more control
Expand Down
29 changes: 29 additions & 0 deletions docs/source/addons/public-folder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
myst:
html_meta:
"description": "How to add static served files from your add-on to your build"
"property=og:description": "How to add static served files to the build from an add-on"
"property=og:title": "Add static files from your add-on to your build"
"keywords": "Volto, Plone, Semantic UI, CSS, Volto theme, add-on, static, assets, files, build"
---

# Add static files from your add-on to your build

In the Volto build process, you can add static files to your build, then serve them along with the compiled files.
Static files are not transformed or compiled by the build process.
They are served as is from the root of the Volto site.
It is useful to define static files such as the following:

- {file}`robots.txt`
- favicon files
- manifest files
- any other static files


## Procedure to include static files

Create a folder named `public` at the root of your add-on, and add the static files to it.
The build process will copy the files, taking into account all add-ons' defined order.
The build process copies first the static files defined by Volto, then the static files from add-ons as defined by their configuration order.
The last defined file overwrites any previously defined files.

2 changes: 2 additions & 0 deletions docs/source/client/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import ploneClient from '@plone/client';

const client = ploneClient.initialize({
apiPath: 'http://localhost:8080/Plone',
token: '', // Optional: auth_token to authorize the user
});
```

Expand Down Expand Up @@ -64,6 +65,7 @@ import { usePathname } from 'next/navigation';

const client = ploneClient.initialize({
apiPath: 'http://localhost:8080/Plone',
token: '', // Optional: auth_token to authorize the user
});

export default function Title() {
Expand Down
7 changes: 0 additions & 7 deletions docs/source/configuration/settings-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,4 @@ criticalCssPath
this file exists it is loaded and its content is embedded inline into the
generated HTML. By default this path is `public/critical.css`. See the
{doc}`../deploying/performance` section for more details.
extractScripts
An object that allows you to configure the insertion of scripts on the page
in some particular cases.
For the moment it admits only one property: `errorPages` whose value is a Boolean.
If `extractScripts.errorPages` is `true`, the JS will be inserted into the error page.
```
58 changes: 58 additions & 0 deletions docs/source/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,64 @@ myst:

<!-- towncrier release notes start -->

## 18.0.0-alpha.35 (2024-06-13)

### Breaking

- Improve container detection, `config.settings.containerBlockTypes` is no longer needed @sneridagh [#6099](https://github.com/plone/volto/issues/6099)

### Bugfix

- Support nested directories in public folder add-on sync folders both in dev and build mode @sneridagh [#6098](https://github.com/plone/volto/issues/6098)
- export getFieldURL from Url.js in helpers @dobri1408 [#6100](https://github.com/plone/volto/issues/6100)

## 18.0.0-alpha.34 (2024-06-13)

### Feature

- Added blocks layout navigator @robgietema @sneridagh [#5642](https://github.com/plone/volto/issues/5642)
- Add support for reading the add-ons `tsconfig.json` paths and add them to the build resolve aliases @sneridagh [#6096](https://github.com/plone/volto/issues/6096)

### Bugfix

- Fix internalUrl Widget to Reflect Prop Changes via onChangeBlock @dorbi1408 @ichim-david [#6036](https://github.com/plone/volto/issues/6036)
- Add default 'l' and 'center' values to size and align fields of `Image` block.
This fixes data not having any value adding proper options to the `Image` block. @ichim-david [#6046](https://github.com/plone/volto/issues/6046)
- Fix public folder in dev mode, now it starts by default with the default Volto core defined public files @sneridagh [#6081](https://github.com/plone/volto/issues/6081)
- Fix link in pop-up in `RelationsMatrix.jsx`. @stevepiercy [#6085](https://github.com/plone/volto/issues/6085)
- Fix Uncaught RangeError: date value is not finite in DateTimeFormat.format. @mauritsvanrees [#6087](https://github.com/plone/volto/issues/6087)
- relations control panel. Restrict eglible relation targets according relation constraints of fields vocabulary. @ksuess [#6091](https://github.com/plone/volto/issues/6091)
- Better `Icon` component JSDoc typings @sneridagh [#6095](https://github.com/plone/volto/issues/6095)

## 18.0.0-alpha.33 (2024-06-06)

### Breaking

- Fix JavaScript events association on error pages. Also remove settings `config.settings.serverConfig.extractScripts.errorPages`. Now scripts are added to error pages, regardless of whether we are in production mode or not. @wesleybl [#6048](https://github.com/plone/volto/issues/6048)
- Breaking from the original slots implementation:
Now `config.getSlots` in the configuration registry takes the argument `location` instead of `pathname`.
This allows to have more expressive conditions, and fulfill the use case of the `Add` form.
@sneridagh [#6063](https://github.com/plone/volto/issues/6063)

### Feature

- Added object browser icon view @robgietema [#5279](https://github.com/plone/volto/issues/5279)
- Refactor TextWidget. @Tishasoumya-02 [#6020](https://github.com/plone/volto/issues/6020)
- Refactor IdWidget -@Tishasoumya-02 [#6027](https://github.com/plone/volto/issues/6027)
- The `ContentTypeCondition` now supports the `Add` form, and detects when you create a content type that is set in the condition. @sneridagh
Added a new `BodyClass` helper while adding a new content type of the form `is-adding-contenttype-mycontenttype`. @sneridagh [#6063](https://github.com/plone/volto/issues/6063)
- Add support for configurable `public` directory defined per add-on. @sneridagh [#6072](https://github.com/plone/volto/issues/6072)

### Bugfix

- Fix block chooser search is not focusable when clicked on add button @iRohitSingh [#5866](https://github.com/plone/volto/issues/5866)
- Fixed skiplink links not tracking focus correctly @JeffersonBledsoe [#5959](https://github.com/plone/volto/issues/5959)
- Remove left and right padding from _Event > Edit recurrence > Repeat on_ buttons when repeating for weekly or yearly events for big fonts, preventing overflow. @sabrina-bongiovanni [#6070](https://github.com/plone/volto/issues/6070)

### Internal

- Fix test script in monorepo root @sneridagh [#6051](https://github.com/plone/volto/issues/6051)

## 18.0.0-alpha.32 (2024-05-23)

### Feature
Expand Down
12 changes: 12 additions & 0 deletions docs/source/upgrade-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ For this purpose, we have developed a {ref}`new utility <upgrade-guide-new-depen
It is mandatory that you run the utility to make Volto version 18.0.0-alpha.21 or later work in your projects.
This opens the door to use {term}`pnpm` in projects, too, and other goodies.

```{versionremoved} 18.0.0-alpha.33
The setting `config.settings.serverConfig.extractScripts.errorPages` has been removed.
```

Now scripts are added to error pages, regardless of whether they are in production mode.
This setting is no longer necessary.


(upgrade-guide-new-dependencies-synchronizer-label)=

### New dependencies synchronizer
Expand Down Expand Up @@ -229,6 +237,10 @@ If your tests rely on the old fieldset's generated value for selecting fields, y
Now `config.getSlots` in the configuration registry takes the argument `location` instead of `pathname`.
This allows more expressive conditions to fulfill the use case of the `Add` form.

### Improve container detection

The mechanism to detect if a block is a container or not has been improved and the config setting `config.settings.containerBlockTypes` is no longer needed, and core won't check for it anymore.

(volto-upgrade-guide-17.x.x)=

## Upgrading to Volto 17.x.x
Expand Down
11 changes: 11 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@

<!-- towncrier release notes start -->

## 1.0.0-alpha.16 (2024-06-06)

### Bugfix

- Fixed querystring search query type @pnicolli [#6034](https://github.com/plone/volto/pull/6034)
- Fixed login mutation @sneridagh [#6053](https://github.com/plone/volto/pull/6053)

### Internal

- Remove custom test runner, using `vitest` config instead @sneridagh [#6056](https://github.com/plone/volto/pull/6056)

## 1.0.0-alpha.15 (2024-05-23)

### Breaking
Expand Down
1 change: 0 additions & 1 deletion packages/client/news/6034.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion packages/client/news/6053.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion packages/client/news/6056.internal

This file was deleted.

1 change: 1 addition & 0 deletions packages/client/news/6076.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation about optional `token` parameter for `ploneClient` initialization. @MAX-786
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"license": "MIT",
"version": "1.0.0-alpha.15",
"version": "1.0.0-alpha.16",
"repository": {
"type": "git",
"url": "[email protected]:plone/volto.git"
Expand Down
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

<!-- towncrier release notes start -->

## 2.0.0-alpha.11 (2024-06-06)

### Bugfix

- Fix ignored classname in breadcrumbs RAC @gomez [#6018](https://github.com/plone/volto/issues/6018)
- Make css layer more specific @pnicolli [#6065](https://github.com/plone/volto/issues/6065)

## 2.0.0-alpha.10 (2024-05-30)

### Bugfix
Expand Down
1 change: 0 additions & 1 deletion packages/components/news/6018.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion packages/components/news/6065.bugfix

This file was deleted.

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.0.0-alpha.10",
"version": "2.0.0-alpha.11",
"repository": {
"type": "git",
"url": "http://github.com/plone/components.git"
Expand Down
31 changes: 31 additions & 0 deletions packages/coresandbox/src/components/Blocks/InputBlock/Data.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { useIntl } from 'react-intl';
import { BlockDataForm } from '@plone/volto/components/manage/Form';
import type { BlockEditProps } from '@plone/types';

const InputBlockData = (props: BlockEditProps) => {
const { block, blocksConfig, contentType, data, navRoot, onChangeBlock } =
props;
const intl = useIntl();
const schema = blocksConfig[data['@type']].blockSchema({ intl, props });

return (
<BlockDataForm
block={block}
schema={schema}
title={schema.title}
onChangeField={(id: string, value: any) => {
onChangeBlock(block, {
...data,
[id]: value,
});
}}
onChangeBlock={onChangeBlock}
formData={data}
blocksConfig={blocksConfig}
navRoot={navRoot}
contentType={contentType}
/>
);
};

export default InputBlockData;
50 changes: 50 additions & 0 deletions packages/coresandbox/src/components/Blocks/InputBlock/Edit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, { useEffect } from 'react';
import { SidebarPortal } from '@plone/volto/components';
import Data from './Data';
import type { BlockEditProps } from '@plone/types';
import { Input, Button } from 'semantic-ui-react';
import { Icon } from '@plone/volto/components';
import aheadSVG from '@plone/volto/icons/ahead.svg';

const InputBlockEdit = (props: BlockEditProps) => {
const { selected, block, data, onChangeBlock } = props;
const [url, setUrl] = React.useState(data?.url);

useEffect(() => {
setUrl(data?.url);
}, [data?.url]);

return (
<>
<div>Input Block Edit</div>

<Input
onChange={(e) => setUrl(e.target.value)}
placeholder={
'Change url to check if the widgets from sidebar are getting updated'
}
value={url}
id="input_block"
/>
<Button
basic
icon
primary
id="add_link"
onClick={(e) => {
onChangeBlock(block, {
...data,
url: url,
});
}}
>
<Icon name={aheadSVG} size="24px" />
</Button>
<SidebarPortal selected={selected}>
<Data {...props} />
</SidebarPortal>
</>
);
};

export default InputBlockEdit;
12 changes: 12 additions & 0 deletions packages/coresandbox/src/components/Blocks/InputBlock/View.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { BlockViewProps } from '@plone/types';

const InputBlockView = (props: BlockViewProps) => {
return (
<div className="test-block">
<div>Input Block</div>
<p>{JSON.stringify(props.data)}</p>
</div>
);
};

export default InputBlockView;
19 changes: 19 additions & 0 deletions packages/coresandbox/src/components/Blocks/InputBlock/schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { BlockConfigBase } from '@plone/types';

export const inputBlockSchema: BlockConfigBase['blockSchema'] = ({ intl }) => ({
title: 'Input Block',
fieldsets: [
{
id: 'default',
title: 'Default',
fields: ['url'],
},
],
properties: {
url: {
widget: 'internal_url',
title: 'url',
},
},
required: [],
});
19 changes: 19 additions & 0 deletions packages/coresandbox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import ListingBlockVariationTeaserContent from './components/Blocks/Listing/List
import NewsAndEvents from './components/Views/NewsAndEvents';
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 { SliderSchema as TestBlockSchema } from './components/Blocks/TestBlock/schema';
import { inputBlockSchema } from './components/Blocks/InputBlock/schema';
import { multipleFieldsetsSchema } from './components/Blocks/TestBlock/schema';
import { conditionalVariationsSchemaEnhancer } from './components/Blocks/schemaEnhancers';
import codeSVG from '@plone/volto/icons/code.svg';
Expand Down Expand Up @@ -37,6 +40,20 @@ const testBlock: BlockConfigBase = {
],
extensions: {},
};
const inputBlock: BlockConfigBase = {
id: 'inputBlock',
title: 'Input Block',
icon: codeSVG,
group: 'common',
view: InputBlockView,
edit: InputBlockEdit,
blockSchema: inputBlockSchema,
restricted: false,
mostUsed: true,
sidebarTab: 1,

extensions: {},
};

const testBlockConditional: BlockConfigBase = {
...testBlock,
Expand Down Expand Up @@ -154,6 +171,7 @@ export const workingCopyFixture = (config: ConfigType) => {
declare module '@plone/types' {
export interface BlocksConfigData {
testBlock: BlockConfigBase;
inputBlock: BlockConfigBase;
testBlockConditional: BlockConfigBase;
testBlockWithConditionalVariations: BlockConfigBase;
testBlockMultipleFieldsets: BlockConfigBase;
Expand All @@ -164,6 +182,7 @@ declare module '@plone/types' {

const applyConfig = (config: ConfigType) => {
config.blocks.blocksConfig.testBlock = testBlock;
config.blocks.blocksConfig.inputBlock = inputBlock;
config.blocks.blocksConfig.testBlockConditional = testBlockConditional;
config.blocks.blocksConfig.testBlockWithConditionalVariations =
testBlockWithConditionalVariations;
Expand Down
6 changes: 6 additions & 0 deletions packages/registry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<!-- towncrier release notes start -->

## 1.6.0 (2024-06-13)

### Feature

- Add support for reading the add-ons `tsconfig.json` paths and add them to the build resolve aliases @sneridagh [#6096](https://github.com/plone/volto/issues/6096)

## 1.5.7 (2024-05-15)

### Bugfix
Expand Down
Loading

0 comments on commit 02ec9a6

Please sign in to comment.