@plone/volto 18.12.1 → 18.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -17,6 +17,12 @@ myst:
17
17
 
18
18
  <!-- towncrier release notes start -->
19
19
 
20
+ ## 18.13.0 (2025-04-22)
21
+
22
+ ### Feature
23
+
24
+ - Allow `object_list` widget to receive a `schemaName` prop, mapped to an utility. @sneridagh [#7007](https://github.com/plone/volto/issues/7007)
25
+
20
26
  ## 18.12.1 (2025-04-15)
21
27
 
22
28
  ### Bugfix
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "18.12.1",
12
+ "version": "18.13.0",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -236,9 +236,9 @@
236
236
  "url": "^0.11.3",
237
237
  "use-deep-compare-effect": "1.8.1",
238
238
  "uuid": "^8.3.2",
239
- "@plone/registry": "2.5.0",
240
239
  "@plone/volto-slate": "18.3.0",
241
- "@plone/scripts": "3.9.0"
240
+ "@plone/scripts": "3.9.0",
241
+ "@plone/registry": "2.5.1"
242
242
  },
243
243
  "devDependencies": {
244
244
  "@babel/core": "^7.0.0",
@@ -363,7 +363,7 @@
363
363
  "webpack-dev-server": "4.11.1",
364
364
  "webpack-node-externals": "3.0.0",
365
365
  "why": "0.6.2",
366
- "@plone/types": "1.3.3",
366
+ "@plone/types": "1.4.0",
367
367
  "@plone/volto-coresandbox": "1.0.0"
368
368
  },
369
369
  "volta": {
@@ -14,6 +14,7 @@ import deleteSVG from '@plone/volto/icons/delete.svg';
14
14
  import addSVG from '@plone/volto/icons/add.svg';
15
15
  import dragSVG from '@plone/volto/icons/drag.svg';
16
16
  import { v4 as uuid } from 'uuid';
17
+ import config from '@plone/volto/registry';
17
18
 
18
19
  const messages = defineMessages({
19
20
  labelRemoveItem: {
@@ -71,11 +72,20 @@ const ObjectListWidget = (props) => {
71
72
  block,
72
73
  fieldSet,
73
74
  id,
74
- schema,
75
75
  value = [],
76
76
  onChange,
77
77
  schemaExtender,
78
+ schemaName,
78
79
  } = props;
80
+
81
+ // This allows to use a `schemaName` prop defined as source of the schema
82
+ // if not present, it will use the schema defined in the schema prop
83
+ const schema =
84
+ config.getUtility({
85
+ type: 'schema',
86
+ name: schemaName,
87
+ }).method || props.schema;
88
+
79
89
  const [localActiveObject, setLocalActiveObject] = React.useState(
80
90
  props.activeObject ?? value.length - 1,
81
91
  );