Skip to content

Commit f42b445

Browse files
Merge branch 'main' into fix-dnd-folder-contents
2 parents 794e4ec + 8623172 commit f42b445

42 files changed

Lines changed: 296 additions & 94 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/2_feature_request.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: '🦄 Feature request'
33
about: 'Suggest an idea for Volto'
44
title: ''
5-
labels: '04 type: enhancement'
5+
labels: ['04 type: enhancement', '30 needs: triage']
66
assignees: ''
77
---
88

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ To ensure your website gets the greatest exposure, add it both to [Awesome Volto
147147
- [Geosphere Austria](https://www.geosphere.at/de) (Website of the Austrian Federal Institute, national geological, geophysical, climatological and meteorological service, 2023)
148148
- [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/en), 2023)
149149
- [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/en), 2022)
150-
- [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/en), 2020)
150+
- [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 (a joint venture of [WAALD](https://www.waald.com/) and [CDLX](https://cdlx.de/)) and [kitconcept GmbH](https://kitconcept.com/en), 2020)
151151
- [ILPO](https://ilpo.jyu.fi/) (the registration portal of continuous learning at the University of Jyväskylä. Developed by University of Jyväskylä, 2022)
152152
- [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)
153153
- [Interpretare.ro](https://www.interpretare.ro) (Romanian medical imaging interpretation service allowing patients to submit MRI, CT, and other diagnostic imaging for professional evaluation by medical specialists, 2022)

‎docs/source/conf.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
r"http://localhost",
8888
# Ignore pages that require authentication
8989
r"https://github.com/plone/volto/issues/new/choose", # requires auth
90+
r"https://javascript.plainenglish.io/you-dont-need-lodash-how-i-gave-up-lodash-693c8b96a07c",
9091
r"https://www.npmjs.com",
9192
# Ignore github.com pages with anchors
9293
r"https://github.com/.*#.*",

‎docs/source/reference/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ This section of the documentation contains reference guides for various aspects
1515
:maxdepth: 1
1616
1717
widgets
18+
utilities
1819
```

‎docs/source/reference/utilities.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "How to type Volto utilities via UtilityTypeMap"
5+
"property=og:description": "How to type Volto utilities via UtilityTypeMap"
6+
"property=og:title": "Typing utilities"
7+
"keywords": "Volto, Plone, utilities, typing, TypeScript"
8+
---
9+
10+
# Typing utilities
11+
12+
`registerUtility`, `getUtility`, and `getUtilities` now bind their method signatures to the utility `type`. You can declare the expected method shape for a given type using the `UtilityTypeMap` interface from `@plone/types`.
13+
14+
## Declare utility method types
15+
16+
Extend `UtilityTypeMap` via module augmentation (for example in `src/types/volto.d.ts`):
17+
18+
```ts
19+
// src/types/volto.d.ts
20+
declare module '@plone/types' {
21+
interface UtilityTypeMap {
22+
rootContentSubRequest: (options: { path: string }) => Promise<unknown>;
23+
// Add more utility types here
24+
}
25+
}
26+
```
27+
28+
## Typed registry usage
29+
30+
Once declared, utilities of that `type` are strongly typed:
31+
32+
```ts
33+
import config from '@plone/registry';
34+
35+
config.registerUtility({
36+
name: 'rootContent',
37+
type: 'rootContentSubRequest',
38+
method: async ({ path }) => fetch(path).then((res) => res.json()),
39+
});
40+
41+
const { method } = config.getUtility({
42+
name: 'rootContent',
43+
type: 'rootContentSubRequest',
44+
});
45+
46+
// method is (options: { path: string }) => Promise<unknown>
47+
method({ path: '/news' });
48+
```
49+
50+
`getUtilities({ type: 'rootContentSubRequest' })` returns an array whose `.method` matches the declared signature.
51+
52+
## Fallback for unknown types
53+
54+
Utility types you do not declare in `UtilityTypeMap` stay permissive and accept `(...args: any[]) => any`, preserving backward compatibility.

‎docs/source/release-notes/index.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@ myst:
1717

1818
<!-- towncrier release notes start -->
1919

20+
## 19.0.0-alpha.20 (2025-12-21)
21+
22+
### Bugfix
23+
24+
- Hide date and time fields when either "Whole Day" or "Open End" is checked in the Event form. @wesleybl [#3243](https://github.com/plone/volto/issues/3243)
25+
- Fixed a bug in the login form where the user could see a spinner instead of an error message after a failed login, when the login form was loaded via server-side rendering. @aryan7081 [#7397](https://github.com/plone/volto/issues/7397)
26+
- Fix max filesize upload issue in drag and drop @Tishasoumya-02 [#7695](https://github.com/plone/volto/issues/7695)
27+
- Fix multilingual redirect for languages using locale-specific formats. @Shyam-Raghuwanshi [#7725](https://github.com/plone/volto/issues/7725)
28+
- Add German translations for the current and parent paths. @iFlameing
29+
- Add support for typing and pasting URLs in the ObjectBrowserWidget for location selection in the Listing block. @iFlameing
30+
31+
### Internal
32+
33+
- Refactored the `FormFieldWrapper` widget by converting it from a class-based component to a modern functional component using React hooks. @Manik-Khajuria-5 [#7672](https://github.com/plone/volto/issues/7672)
34+
- Update TypeScript types for Volto. @wesleybl [#7703](https://github.com/plone/volto/issues/7703)
35+
- Include other *.md files in the repo root for link checking, fix redirecting links, and remove non-responsive server. @stevepiercy [#7712](https://github.com/plone/volto/issues/7712)
36+
- Update actions/checkout to v5 in all GitHub Actions workflows. @wesleybl [#7724](https://github.com/plone/volto/issues/7724)
37+
- Update actions/cache from v4 to v5 in GitHub Actions workflow files. @wesleybl [#7731](https://github.com/plone/volto/issues/7731)
38+
- Sync react-aria-components to 1.14.0 in catalog.json and nextjs package.json. @wesleybl [#7733](https://github.com/plone/volto/issues/7733)
39+
40+
### Documentation
41+
42+
- Add Volto 19 add-on development documentation. @Shyam-Raghuwanshi [#7694](https://github.com/plone/volto/issues/7694)
43+
- Exclude `linkedin.com` from link checker. @davisagli
44+
2045
## 19.0.0-alpha.19 (2025-12-08)
2146

2247
### Feature

‎packages/components/news/+fixRAC1.14.0.internal‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎packages/registry/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
<!-- towncrier release notes start -->
1010

11+
## 3.0.0-alpha.9 (2025-12-22)
12+
13+
### Feature
14+
15+
- Enhance registry utilities type definitions with typed method signatures. @ompharate @sneridagh [#7652](https://github.com/plone/volto/issues/7652)
16+
1117
## 3.0.0-alpha.8 (2025-11-03)
1218

1319
### Breaking

‎packages/registry/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"funding": "https://github.com/sponsors/plone",
1111
"license": "MIT",
12-
"version": "3.0.0-alpha.8",
12+
"version": "3.0.0-alpha.9",
1313
"repository": {
1414
"type": "git",
1515
"url": "https://github.com/plone/volto.git"

‎packages/registry/src/index.ts‎

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import type {
1515
WidgetsConfig,
1616
ReactRouterRouteEntry,
1717
WidgetKey,
18+
UtilityTypeMap,
19+
Utility,
1820
} from '@plone/types';
1921

2022
export type ConfigData = {
@@ -35,8 +37,12 @@ type GetComponentResult = {
3537
component: React.ComponentType<any>;
3638
};
3739

38-
type GetUtilityResult = {
39-
method: (...args: any[]) => any;
40+
type UtilityMethodFor<Type extends string> = Type extends keyof UtilityTypeMap
41+
? UtilityTypeMap[Type]
42+
: (...args: any[]) => any;
43+
44+
type GetUtilityResult<Type extends string = string> = {
45+
method: UtilityMethodFor<Type>;
4046
};
4147

4248
export type ConfigType = InstanceType<typeof Config>;
@@ -459,11 +465,11 @@ class Config {
459465
}
460466
}
461467

462-
registerUtility(options: {
468+
registerUtility<Type extends string>(options: {
463469
name: string;
464-
type: string;
470+
type: Type;
465471
dependencies?: Record<string, string>;
466-
method: (args: any) => any;
472+
method: UtilityMethodFor<Type>;
467473
}) {
468474
const { name, type, method, dependencies = {} } = options;
469475
let depsString: string = '';
@@ -477,19 +483,19 @@ class Config {
477483
}
478484
const utilityName = `${depsString ? `|${depsString}` : ''}${name}`;
479485

480-
let utilityType = this._data.utilities[type];
486+
let utilityType = this._data.utilities[type] as Utility<Type> | undefined;
481487
if (!utilityType) {
482-
this._data.utilities[type] = {};
483-
utilityType = this._data.utilities[type];
488+
this._data.utilities[type] = {} as Utility<Type>;
489+
utilityType = this._data.utilities[type] as Utility<Type>;
484490
}
485491
utilityType[utilityName] = { method };
486492
}
487493

488-
getUtility(options: {
494+
getUtility<Type extends string>(options: {
489495
name: string;
490-
type: string;
496+
type: Type;
491497
dependencies?: Record<string, string>;
492-
}): GetUtilityResult | Record<string, never> {
498+
}): GetUtilityResult<Type> | Record<string, never> {
493499
const { name, type, dependencies = {} } = options;
494500

495501
if (!name || !type) return {};
@@ -500,14 +506,17 @@ class Config {
500506
.join('+');
501507

502508
const utilityName = `${depsString ? `|${depsString}` : ''}${name}`;
509+
const utilitiesForType = this._data.utilities[type] as
510+
| Utility<Type>
511+
| undefined;
503512

504-
return this._data.utilities[type]?.[utilityName] || {};
513+
return utilitiesForType?.[utilityName] || {};
505514
}
506515

507-
getUtilities(options: {
508-
type: string;
516+
getUtilities<Type extends string>(options: {
517+
type: Type;
509518
dependencies?: Record<string, string>;
510-
}): Array<GetUtilityResult> | [] {
519+
}): Array<GetUtilityResult<Type>> | [] {
511520
const { type, dependencies = {} } = options;
512521

513522
if (!type) return [];
@@ -517,13 +526,16 @@ class Config {
517526
.map((key) => `${key}:${dependencies[key]}`)
518527
.join('+');
519528

529+
const utilitiesForType = this._data.utilities[type] as
530+
| Utility<Type>
531+
| undefined;
532+
if (!utilitiesForType) return [];
533+
520534
const utilityName = `${depsString ? `|${depsString}` : ''}`;
521-
const utilitiesKeys = Object.keys(this._data.utilities[type] || {}).filter(
522-
(key) => key.startsWith(utilityName),
523-
);
524-
const utilities = utilitiesKeys.map(
525-
(key) => this._data.utilities[type][key],
535+
const utilitiesKeys = Object.keys(utilitiesForType).filter((key) =>
536+
key.startsWith(utilityName),
526537
);
538+
const utilities = utilitiesKeys.map((key) => utilitiesForType[key]);
527539

528540
return utilities;
529541
}

0 commit comments

Comments
 (0)