@plone/volto 19.0.0-alpha.31 → 19.0.0-alpha.33
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/AGENTS.md +47 -0
- package/CHANGELOG.md +27 -0
- package/README.md +0 -1
- package/package.json +11 -14
- package/src/actions/controlpanels/controlpanels.js +7 -12
- package/src/actions/controlpanels/controlpanels.test.js +2 -3
- package/src/components/manage/Contents/Contents.jsx +410 -323
- package/src/components/manage/Contents/Contents.test.jsx +1 -1
- package/src/components/manage/Contents/ContentsIndexHeader.jsx +47 -81
- package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +10 -3
- package/src/components/manage/Contents/ContentsItem.jsx +226 -278
- package/src/components/manage/Contents/ContentsItem.test.jsx +10 -6
- package/src/components/manage/Controlpanels/ContentType.jsx +131 -222
- package/src/components/manage/Controlpanels/Controlpanel.jsx +122 -218
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +1 -29
- package/src/components/manage/Form/Field.jsx +1 -69
- package/src/components/manage/Form/Form.jsx +8 -0
- package/src/components/manage/Form/Form.test.jsx +130 -1
- package/src/components/manage/Widgets/ArrayWidget.jsx +111 -88
- package/src/components/manage/Widgets/ArrayWidget.test.jsx +0 -6
- package/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +56 -50
- package/src/components/manage/Widgets/SelectStyling.jsx +52 -20
- package/src/config/Loadables.jsx +1 -5
- package/src/config/index.js +3 -0
- package/src/helpers/Utils/withSaveAsDraft.jsx +33 -9
- package/src/server.jsx +7 -1
- package/theme/themes/pastanaga/extras/contents.less +0 -4
- package/types/components/manage/Contents/Contents.d.ts +1 -1
- package/types/components/manage/Contents/ContentsIndexHeader.d.ts +6 -11
- package/types/components/manage/Contents/ContentsItem.d.ts +3 -10
- package/types/components/manage/Controlpanels/ContentType.d.ts +2 -2
- package/types/components/manage/Controlpanels/Controlpanel.d.ts +2 -5
- package/types/components/manage/Controlpanels/index.d.ts +2 -2
- package/types/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.d.ts +22 -5
- package/types/components/manage/Widgets/SelectStyling.d.ts +1 -0
|
@@ -9,6 +9,7 @@ import checkSVG from '@plone/volto/icons/check.svg';
|
|
|
9
9
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
10
10
|
import { useIntl, defineMessages } from 'react-intl';
|
|
11
11
|
import { useLocation } from 'react-router-dom';
|
|
12
|
+
import config from '@plone/volto/registry';
|
|
12
13
|
|
|
13
14
|
const messages = defineMessages({
|
|
14
15
|
autoSaveFound: {
|
|
@@ -227,15 +228,38 @@ export default function withSaveAsDraft(options) {
|
|
|
227
228
|
WrappedComponent,
|
|
228
229
|
)})`;
|
|
229
230
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
const DraftWrappedComponent = forwardRef
|
|
232
|
+
? hoistNonReactStatics(
|
|
233
|
+
React.forwardRef((props, ref) => (
|
|
234
|
+
<WithSaveAsDraft {...props} forwardedRef={ref} />
|
|
235
|
+
)),
|
|
236
|
+
WrappedComponent,
|
|
237
|
+
)
|
|
238
|
+
: hoistNonReactStatics(WithSaveAsDraft, WrappedComponent);
|
|
239
|
+
|
|
240
|
+
const WithExperimentalSaveAsDraft = forwardRef
|
|
241
|
+
? hoistNonReactStatics(
|
|
242
|
+
React.forwardRef((props, ref) => {
|
|
243
|
+
const ComponentToRender = config.experimental?.saveAsDraft?.enabled
|
|
244
|
+
? DraftWrappedComponent
|
|
245
|
+
: WrappedComponent;
|
|
246
|
+
|
|
247
|
+
return <ComponentToRender {...props} ref={ref} />;
|
|
248
|
+
}),
|
|
249
|
+
WrappedComponent,
|
|
250
|
+
)
|
|
251
|
+
: hoistNonReactStatics((props) => {
|
|
252
|
+
const ComponentToRender = config.experimental?.saveAsDraft?.enabled
|
|
253
|
+
? DraftWrappedComponent
|
|
254
|
+
: WrappedComponent;
|
|
255
|
+
|
|
256
|
+
return <ComponentToRender {...props} />;
|
|
257
|
+
}, WrappedComponent);
|
|
258
|
+
|
|
259
|
+
WithExperimentalSaveAsDraft.displayName = `WithExperimentalSaveAsDraft(${getDisplayName(
|
|
260
|
+
WrappedComponent,
|
|
261
|
+
)})`;
|
|
238
262
|
|
|
239
|
-
return
|
|
263
|
+
return WithExperimentalSaveAsDraft;
|
|
240
264
|
};
|
|
241
265
|
}
|
package/src/server.jsx
CHANGED
|
@@ -268,7 +268,13 @@ server.get('/*', (req, res) => {
|
|
|
268
268
|
? initialLang
|
|
269
269
|
: state.content.data?.language?.token || initialLang;
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
const isMultilingual = state.site.data.features?.multilingual;
|
|
272
|
+
|
|
273
|
+
if (
|
|
274
|
+
toBackendLang(initialLang) !== contentLang &&
|
|
275
|
+
!/\/\.well-known\/.*$/.test(location.pathname) &&
|
|
276
|
+
!(isMultilingual && location.pathname === '/')
|
|
277
|
+
) {
|
|
272
278
|
const newLang = toReactIntlLang(
|
|
273
279
|
new locale.Locales(contentLang).best(supported).toString(),
|
|
274
280
|
);
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
export function ContentsIndexHeaderComponent({
|
|
2
|
-
|
|
1
|
+
export function ContentsIndexHeaderComponent({ id, width, label, dndKitSortable, dndKitUtilities, }: {
|
|
2
|
+
id: any;
|
|
3
3
|
width: any;
|
|
4
4
|
label: any;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}): string;
|
|
5
|
+
dndKitSortable: any;
|
|
6
|
+
dndKitUtilities: any;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export namespace ContentsIndexHeaderComponent {
|
|
10
9
|
namespace propTypes {
|
|
10
|
+
let id: any;
|
|
11
11
|
let width: any;
|
|
12
12
|
let label: any;
|
|
13
|
-
let connectDragSource: any;
|
|
14
|
-
let connectDropTarget: any;
|
|
15
|
-
let isDragging: any;
|
|
16
|
-
let order: any;
|
|
17
|
-
let onOrderIndex: any;
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
15
|
declare const _default: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function ContentsItemComponent({ item, selected, onClick, indexes, onCut, onCopy, onDelete, onMoveToTop, onMoveToBottom,
|
|
1
|
+
export function ContentsItemComponent({ item, selected, onClick, indexes, onCut, onCopy, onDelete, onMoveToTop, onMoveToBottom, order, dndKitSortable, dndKitUtilities, }: {
|
|
2
2
|
item: any;
|
|
3
3
|
selected: any;
|
|
4
4
|
onClick: any;
|
|
@@ -8,11 +8,9 @@ export function ContentsItemComponent({ item, selected, onClick, indexes, onCut,
|
|
|
8
8
|
onDelete: any;
|
|
9
9
|
onMoveToTop: any;
|
|
10
10
|
onMoveToBottom: any;
|
|
11
|
-
connectDragPreview: any;
|
|
12
|
-
connectDragSource: any;
|
|
13
|
-
connectDropTarget: any;
|
|
14
|
-
isDragging: any;
|
|
15
11
|
order: any;
|
|
12
|
+
dndKitSortable: any;
|
|
13
|
+
dndKitUtilities: any;
|
|
16
14
|
}): string;
|
|
17
15
|
export namespace ContentsItemComponent {
|
|
18
16
|
namespace propTypes {
|
|
@@ -25,12 +23,7 @@ export namespace ContentsItemComponent {
|
|
|
25
23
|
let onDelete: any;
|
|
26
24
|
let onMoveToTop: any;
|
|
27
25
|
let onMoveToBottom: any;
|
|
28
|
-
let connectDragPreview: any;
|
|
29
|
-
let connectDragSource: any;
|
|
30
|
-
let connectDropTarget: any;
|
|
31
|
-
let isDragging: any;
|
|
32
26
|
let order: any;
|
|
33
|
-
let onOrderItem: any;
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
declare const _default: any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export default ContentType;
|
|
2
|
+
declare function ContentType(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
export default _default;
|
|
5
|
-
import React from 'react';
|
|
1
|
+
export default Controlpanel;
|
|
2
|
+
declare function Controlpanel(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const Controlpanels: any;
|
|
2
|
-
export declare const Controlpanel: import("@loadable/component").LoadableComponent<
|
|
2
|
+
export declare const Controlpanel: import("@loadable/component").LoadableComponent<unknown>;
|
|
3
3
|
export declare const RulesControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
4
4
|
export declare const AddRuleControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
5
5
|
export declare const EditRuleControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
@@ -13,7 +13,7 @@ export declare const RelationsControlpanel: import("@loadable/component").Loadab
|
|
|
13
13
|
export declare const AliasesControlpanel: import("@loadable/component").LoadableComponent<any>;
|
|
14
14
|
export declare const UndoControlpanel: import("@loadable/component").LoadableClassComponent<any>;
|
|
15
15
|
export declare const AddonsControlpanel: import("@loadable/component").LoadableComponent<any>;
|
|
16
|
-
export declare const ContentType: import("@loadable/component").
|
|
16
|
+
export declare const ContentType: import("@loadable/component").LoadableComponent<unknown>;
|
|
17
17
|
export declare const ContentTypeLayout: import("@loadable/component").LoadableClassComponent<any>;
|
|
18
18
|
export declare const ContentTypeSchema: import("@loadable/component").LoadableClassComponent<any>;
|
|
19
19
|
export declare const ContentTypes: import("@loadable/component").LoadableClassComponent<any>;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export default WeekdayOfTheMonthIndexField;
|
|
2
|
+
declare function WeekdayOfTheMonthIndexField({ disabled, value, onChange, ...otherProps }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
disabled: any;
|
|
5
|
+
value: any;
|
|
6
|
+
onChange: any;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace WeekdayOfTheMonthIndexField {
|
|
9
|
+
namespace propTypes {
|
|
10
|
+
let disabled: any;
|
|
11
|
+
let value: any;
|
|
12
|
+
let onChange: any;
|
|
13
|
+
}
|
|
14
|
+
namespace defaultProps {
|
|
15
|
+
let disabled_1: boolean;
|
|
16
|
+
export { disabled_1 as disabled };
|
|
17
|
+
let value_1: any;
|
|
18
|
+
export { value_1 as value };
|
|
19
|
+
let onChange_1: any;
|
|
20
|
+
export { onChange_1 as onChange };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -4,6 +4,7 @@ export function MenuList({ children }: {
|
|
|
4
4
|
export const SortableMultiValue: any;
|
|
5
5
|
export const SortableMultiValueLabel: any;
|
|
6
6
|
export const MultiValueContainer: any;
|
|
7
|
+
export const MultiValueRemove: any;
|
|
7
8
|
export const Option: any;
|
|
8
9
|
export const DropdownIndicator: any;
|
|
9
10
|
export const ClearIndicator: any;
|