@kitconcept/volto-light-theme 8.0.0-alpha.27 → 8.0.0-alpha.28
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.draft
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
## 8.0.0-alpha.
|
|
1
|
+
## 8.0.0-alpha.28 (2026-05-15)
|
|
2
|
+
|
|
3
|
+
### Bugfix
|
|
4
|
+
|
|
5
|
+
- Fix Search icon color changes when changing footer font color @iRohitSingh [#850](https://github.com/kitconcept/volto-light-theme/pull/850)
|
|
6
|
+
- Fix customized ObjectListWidget to support the `schemaExtender` prop. @davisagli
|
|
2
7
|
|
|
3
8
|
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 8.0.0-alpha.28 (2026-05-15)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Fix Search icon color changes when changing footer font color @iRohitSingh [#850](https://github.com/kitconcept/volto-light-theme/pull/850)
|
|
16
|
+
- Fix customized ObjectListWidget to support the `schemaExtender` prop. @davisagli
|
|
17
|
+
|
|
11
18
|
## 8.0.0-alpha.27 (2026-05-12)
|
|
12
19
|
|
|
13
20
|
## 8.0.0-alpha.26 (2026-05-12)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitconcept/volto-light-theme",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.28",
|
|
4
4
|
"description": "Volto Light Theme by kitconcept",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"release-it": "^19.0.3",
|
|
48
48
|
"typescript": "^5.7.3",
|
|
49
49
|
"vitest": "^3.1.2",
|
|
50
|
-
"@plone/types": "2.0.0-alpha.
|
|
50
|
+
"@plone/types": "2.0.0-alpha.19"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@dnd-kit/core": "6.0.8",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"react-aria-components": "^1.17.0",
|
|
60
60
|
"react-colorful": "^5.6.1",
|
|
61
61
|
"uuid": "^11.0.0",
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
62
|
+
"@kitconcept/volto-bm3-compat": "^1.0.0-alpha.1",
|
|
63
|
+
"@plone/components": "^4.0.0-alpha.8"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"classnames": "^2.5.1",
|
|
@@ -16,10 +16,11 @@ import deleteSVG from '@plone/volto/icons/delete.svg';
|
|
|
16
16
|
import addSVG from '@plone/volto/icons/add.svg';
|
|
17
17
|
import dragSVG from '@plone/volto/icons/drag.svg';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
|
19
|
-
import type {
|
|
19
|
+
import type { Content, JSONSchema } from '@plone/types';
|
|
20
20
|
import type { IntlShape } from 'react-intl';
|
|
21
21
|
import config from '@plone/volto/registry';
|
|
22
22
|
import isEmpty from 'lodash/isEmpty';
|
|
23
|
+
import { type DragEndEvent } from '@dnd-kit/core';
|
|
23
24
|
|
|
24
25
|
const messages = defineMessages({
|
|
25
26
|
labelRemoveItem: {
|
|
@@ -114,11 +115,22 @@ export type ObjectListWidgetProps = {
|
|
|
114
115
|
*/
|
|
115
116
|
schemaEnhancer?: (args: {
|
|
116
117
|
schema: JSONSchema & { addMessage: string };
|
|
117
|
-
formData:
|
|
118
|
+
formData: object;
|
|
118
119
|
intl: IntlShape;
|
|
119
|
-
navRoot
|
|
120
|
-
contentType
|
|
120
|
+
navRoot?: Content;
|
|
121
|
+
contentType?: string;
|
|
121
122
|
}) => JSONSchema;
|
|
123
|
+
/**
|
|
124
|
+
* Another optional function to enhance the schema.
|
|
125
|
+
* (Deprecated API with fewer supported arguments.
|
|
126
|
+
* This is here for backwards-compatibility
|
|
127
|
+
* with the ObjectListWidget in Volto.)
|
|
128
|
+
*/
|
|
129
|
+
schemaExtender?: (
|
|
130
|
+
schema: JSONSchema,
|
|
131
|
+
formData: object,
|
|
132
|
+
intl: IntlShape,
|
|
133
|
+
) => JSONSchema;
|
|
122
134
|
};
|
|
123
135
|
|
|
124
136
|
const EMPTY_SCHEMA = {
|
|
@@ -141,14 +153,16 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
141
153
|
value = [],
|
|
142
154
|
onChange,
|
|
143
155
|
schemaEnhancer,
|
|
156
|
+
schemaExtender,
|
|
144
157
|
schemaName,
|
|
145
158
|
} = props;
|
|
146
159
|
|
|
147
160
|
const schema =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
161
|
+
(schemaName &&
|
|
162
|
+
config.getUtility({
|
|
163
|
+
type: 'schema',
|
|
164
|
+
name: schemaName,
|
|
165
|
+
}).method) ||
|
|
152
166
|
props.schema ||
|
|
153
167
|
EMPTY_SCHEMA;
|
|
154
168
|
|
|
@@ -170,7 +184,7 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
170
184
|
|
|
171
185
|
const intl = useIntl();
|
|
172
186
|
|
|
173
|
-
function handleChangeActiveObject(index) {
|
|
187
|
+
function handleChangeActiveObject(index: number) {
|
|
174
188
|
const newIndex = activeObject === index ? -1 : index;
|
|
175
189
|
|
|
176
190
|
setActiveObject(newIndex);
|
|
@@ -178,13 +192,22 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
178
192
|
|
|
179
193
|
const objectSchema =
|
|
180
194
|
typeof schema === 'function' ? schema({ ...props, activeObject }) : schema;
|
|
195
|
+
const getEnhancedSchema = (data: object) => {
|
|
196
|
+
const enhancedSchema = schemaEnhancer
|
|
197
|
+
? schemaEnhancer({ schema: objectSchema, formData: data, intl })
|
|
198
|
+
: objectSchema;
|
|
199
|
+
const extendedSchema = schemaExtender
|
|
200
|
+
? schemaExtender(objectSchema, data, intl)
|
|
201
|
+
: enhancedSchema;
|
|
202
|
+
return extendedSchema;
|
|
203
|
+
};
|
|
181
204
|
|
|
182
|
-
function handleDragEnd(event) {
|
|
205
|
+
function handleDragEnd(event: DragEndEvent) {
|
|
183
206
|
const { active, over } = event;
|
|
184
207
|
|
|
185
|
-
if (active.id !== over
|
|
208
|
+
if (active.id !== over?.id) {
|
|
186
209
|
const source = value.findIndex((item) => item['@id'] === active.id);
|
|
187
|
-
const destination = value.findIndex((item) => item['@id'] === over
|
|
210
|
+
const destination = value.findIndex((item) => item['@id'] === over?.id);
|
|
188
211
|
|
|
189
212
|
const newValue = reorderArray(value, source, destination);
|
|
190
213
|
onChange(id, newValue);
|
|
@@ -205,13 +228,9 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
205
228
|
'@id': uuid(),
|
|
206
229
|
};
|
|
207
230
|
|
|
208
|
-
const objSchema = schemaEnhancer
|
|
209
|
-
? // @ts-ignore - TODO Make sure this continues to have sense
|
|
210
|
-
schemaEnhancer({ schema: objectSchema, formData: data, intl })
|
|
211
|
-
: objectSchema;
|
|
212
231
|
const dataWithDefaults = applySchemaDefaults({
|
|
213
232
|
data,
|
|
214
|
-
schema:
|
|
233
|
+
schema: getEnhancedSchema(data),
|
|
215
234
|
intl,
|
|
216
235
|
});
|
|
217
236
|
|
|
@@ -318,16 +337,7 @@ const ObjectListWidget = (props: ObjectListWidgetProps) => {
|
|
|
318
337
|
id={`${uid}`}
|
|
319
338
|
key={`olw-${uid}`}
|
|
320
339
|
block={block}
|
|
321
|
-
schema={
|
|
322
|
-
schemaEnhancer
|
|
323
|
-
? // @ts-ignore - TODO Make sure this continues to have sense
|
|
324
|
-
schemaEnhancer({
|
|
325
|
-
schema: objectSchema,
|
|
326
|
-
formData: item,
|
|
327
|
-
intl,
|
|
328
|
-
})
|
|
329
|
-
: objectSchema
|
|
330
|
-
}
|
|
340
|
+
schema={getEnhancedSchema(item)}
|
|
331
341
|
value={item}
|
|
332
342
|
onChange={(fieldId: string, fieldValue: any) => {
|
|
333
343
|
const newvalue = value.map((v, i) =>
|