@plone/volto 18.0.0-alpha.15 → 18.0.0-alpha.16
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 +11 -0
- package/package.json +12 -13
- package/src/components/index.js +9 -8
- package/src/components/manage/Blocks/Image/Edit.jsx +12 -12
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +3 -3
- package/src/components/manage/Blocks/Image/View.jsx +14 -14
- package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +6 -6
- package/src/components/manage/Blocks/Search/SelectStyling.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/CheckboxFacet.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/Facets.jsx +2 -2
- package/src/components/manage/Blocks/Search/components/SelectStyling.jsx +4 -4
- package/src/components/manage/Contents/Contents.jsx +3 -3
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +4 -4
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +2 -2
- package/src/components/manage/Display/Display.jsx +2 -2
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +10 -10
- package/src/components/manage/Widgets/ArrayWidget.jsx +21 -21
- package/src/components/manage/Widgets/FileWidget.jsx +2 -2
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +2 -2
- package/src/components/manage/Widgets/ReferenceWidget.jsx +2 -2
- package/src/components/manage/Widgets/SelectAutoComplete.jsx +6 -6
- package/src/components/manage/Widgets/SelectStyling.jsx +4 -4
- package/src/components/manage/Widgets/SelectUtils.js +2 -2
- package/src/components/manage/Workflow/Workflow.jsx +2 -2
- package/src/components/theme/Widgets/BooleanWidget.jsx +2 -2
- package/src/config/Loadables.jsx +10 -10
- package/src/config/Views.jsx +2 -2
- package/src/config/Widgets.jsx +7 -6
- package/src/helpers/Blocks/Blocks.js +20 -20
- package/src/helpers/Html/Html.jsx +2 -2
- package/src/helpers/Utils/Date.js +6 -6
- package/src/helpers/Utils/Utils.js +2 -2
- package/src/store.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,17 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 18.0.0-alpha.16 (2024-03-02)
|
|
21
|
+
|
|
22
|
+
### Internal
|
|
23
|
+
|
|
24
|
+
- Update dependencies
|
|
25
|
+
Fix prettier due to new version @sneridagh [#5815](https://github.com/plone/volto/issues/5815)
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
- Linkcheck thinks `README.md` is `http://README.md`. Bad linkcheck, no more 🍺 for you. @stevepiercy [#5816](https://github.com/plone/volto/issues/5816)
|
|
30
|
+
|
|
20
31
|
## 18.0.0-alpha.15 (2024-03-01)
|
|
21
32
|
|
|
22
33
|
### Breaking
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "18.0.0-alpha.
|
|
12
|
+
"version": "18.0.0-alpha.16",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -159,6 +159,7 @@
|
|
|
159
159
|
"@loadable/component": "5.14.1",
|
|
160
160
|
"@loadable/server": "5.14.0",
|
|
161
161
|
"@loadable/webpack-plugin": "5.15.2",
|
|
162
|
+
"@redux-devtools/extension": "^3.3.0",
|
|
162
163
|
"@types/react": "^18.2.57",
|
|
163
164
|
"@types/react-dom": "^18.2.19",
|
|
164
165
|
"autoprefixer": "10.4.8",
|
|
@@ -189,13 +190,13 @@
|
|
|
189
190
|
"draft-js-plugins-utils": "2.0.3",
|
|
190
191
|
"draftjs-filters": "2.3.0",
|
|
191
192
|
"eslint": "8.49.0",
|
|
192
|
-
"eslint-config-prettier": "9.
|
|
193
|
+
"eslint-config-prettier": "9.1.0",
|
|
193
194
|
"eslint-config-react-app": "7.0.1",
|
|
194
195
|
"eslint-import-resolver-alias": "1.1.2",
|
|
195
196
|
"eslint-import-resolver-babel-plugin-root-import": "1.1.1",
|
|
196
|
-
"eslint-plugin-import": "2.
|
|
197
|
+
"eslint-plugin-import": "2.29.1",
|
|
197
198
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
198
|
-
"eslint-plugin-prettier": "5.
|
|
199
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
199
200
|
"eslint-plugin-react": "7.33.2",
|
|
200
201
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
201
202
|
"express": "4.17.3",
|
|
@@ -235,7 +236,7 @@
|
|
|
235
236
|
"postcss-overrides": "3.1.4",
|
|
236
237
|
"postcss-scss": "4.0.6",
|
|
237
238
|
"prepend-http": "2",
|
|
238
|
-
"prettier": "3.
|
|
239
|
+
"prettier": "3.2.5",
|
|
239
240
|
"pretty-bytes": "5.3.0",
|
|
240
241
|
"prismjs": "1.27.0",
|
|
241
242
|
"process": "^0.11.10",
|
|
@@ -283,7 +284,6 @@
|
|
|
283
284
|
"redux": "4.2.1",
|
|
284
285
|
"redux-actions": "3.0.0",
|
|
285
286
|
"redux-connect": "10.0.0",
|
|
286
|
-
"redux-devtools-extension": "2.13.9",
|
|
287
287
|
"redux-localstorage-simple": "2.5.1",
|
|
288
288
|
"redux-mock-store": "1.5.4",
|
|
289
289
|
"redux-thunk": "2.4.2",
|
|
@@ -296,9 +296,9 @@
|
|
|
296
296
|
"slate-react": "0.98.4",
|
|
297
297
|
"start-server-and-test": "1.14.0",
|
|
298
298
|
"style-loader": "3.3.1",
|
|
299
|
-
"stylelint": "
|
|
300
|
-
"stylelint-config-idiomatic-order": "
|
|
301
|
-
"stylelint-prettier": "
|
|
299
|
+
"stylelint": "16.2.1",
|
|
300
|
+
"stylelint-config-idiomatic-order": "10.0.0",
|
|
301
|
+
"stylelint-prettier": "5.0.0",
|
|
302
302
|
"superagent": "3.8.2",
|
|
303
303
|
"svg-loader": "0.0.2",
|
|
304
304
|
"svgo-loader": "3.0.3",
|
|
@@ -315,10 +315,9 @@
|
|
|
315
315
|
"webpack-dev-server": "4.11.1",
|
|
316
316
|
"webpack-node-externals": "3.0.0",
|
|
317
317
|
"xmlrpc": "1.3.2",
|
|
318
|
-
"
|
|
319
|
-
"@plone/
|
|
320
|
-
"@plone/
|
|
321
|
-
"@plone/scripts": "3.3.2"
|
|
318
|
+
"@plone/registry": "1.5.1",
|
|
319
|
+
"@plone/volto-slate": "18.0.0-alpha.9",
|
|
320
|
+
"@plone/scripts": "3.4.0"
|
|
322
321
|
},
|
|
323
322
|
"devDependencies": {
|
|
324
323
|
"@jest/globals": "^29.7.0",
|
package/src/components/index.js
CHANGED
|
@@ -64,8 +64,8 @@ export { default as FileView } from '@plone/volto/components/theme/View/FileView
|
|
|
64
64
|
export { default as ImageView } from '@plone/volto/components/theme/View/ImageView';
|
|
65
65
|
export { default as NewsItemView } from '@plone/volto/components/theme/View/NewsItemView';
|
|
66
66
|
|
|
67
|
-
export const EventView = loadable(
|
|
68
|
-
import('@plone/volto/components/theme/View/EventView'),
|
|
67
|
+
export const EventView = loadable(
|
|
68
|
+
() => import('@plone/volto/components/theme/View/EventView'),
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
export { default as ListingView } from '@plone/volto/components/theme/View/ListingView';
|
|
@@ -152,13 +152,14 @@ export { default as FormFieldWrapper } from '@plone/volto/components/manage/Widg
|
|
|
152
152
|
export { default as ArrayWidget } from '@plone/volto/components/manage/Widgets/ArrayWidget';
|
|
153
153
|
export { default as CheckboxWidget } from '@plone/volto/components/manage/Widgets/CheckboxWidget';
|
|
154
154
|
|
|
155
|
-
export const DatetimeWidget = loadable(
|
|
156
|
-
import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
|
|
155
|
+
export const DatetimeWidget = loadable(
|
|
156
|
+
() => import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
|
|
157
157
|
);
|
|
158
|
-
export const RecurrenceWidget = loadable(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
export const RecurrenceWidget = loadable(
|
|
159
|
+
() =>
|
|
160
|
+
import(
|
|
161
|
+
'@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
|
|
162
|
+
),
|
|
162
163
|
);
|
|
163
164
|
|
|
164
165
|
export { default as FileWidget } from '@plone/volto/components/manage/Widgets/FileWidget';
|
|
@@ -283,19 +283,19 @@ class Edit extends Component {
|
|
|
283
283
|
data.image_scales
|
|
284
284
|
? undefined
|
|
285
285
|
: isInternalURL(data.url)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
? // Backwards compat in the case that the block is storing the full server URL
|
|
287
|
+
(() => {
|
|
288
|
+
if (data.size === 'l')
|
|
289
|
+
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
290
|
+
if (data.size === 'm')
|
|
291
|
+
return `${flattenToAppURL(
|
|
292
|
+
data.url,
|
|
293
|
+
)}/@@images/image/preview`;
|
|
294
|
+
if (data.size === 's')
|
|
295
|
+
return `${flattenToAppURL(data.url)}/@@images/image/mini`;
|
|
289
296
|
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
data.url,
|
|
293
|
-
)}/@@images/image/preview`;
|
|
294
|
-
if (data.size === 's')
|
|
295
|
-
return `${flattenToAppURL(data.url)}/@@images/image/mini`;
|
|
296
|
-
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
297
|
-
})()
|
|
298
|
-
: data.url
|
|
297
|
+
})()
|
|
298
|
+
: data.url
|
|
299
299
|
}
|
|
300
300
|
sizes={config.blocks.blocksConfig.image.getSizes(data)}
|
|
301
301
|
alt={data.alt || ''}
|
|
@@ -61,9 +61,9 @@ const ImageSidebar = (props) => {
|
|
|
61
61
|
data.image_scales
|
|
62
62
|
? undefined
|
|
63
63
|
: isInternalURL(data.url)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
? // Backwards compat in the case that the block is storing the full server URL
|
|
65
|
+
`${flattenToAppURL(data.url)}/@@images/image/preview`
|
|
66
|
+
: data.url
|
|
67
67
|
}
|
|
68
68
|
sizes="188px"
|
|
69
69
|
alt={intl.formatMessage(messages.preview)}
|
|
@@ -51,21 +51,21 @@ export const View = ({ className, data, detached, properties, style }) => {
|
|
|
51
51
|
data.image_scales
|
|
52
52
|
? undefined
|
|
53
53
|
: isInternalURL(data.url)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
? // Backwards compat in the case that the block is storing the full server URL
|
|
55
|
+
(() => {
|
|
56
|
+
if (data.size === 'l')
|
|
57
|
+
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
58
|
+
if (data.size === 'm')
|
|
59
|
+
return `${flattenToAppURL(
|
|
60
|
+
data.url,
|
|
61
|
+
)}/@@images/image/preview`;
|
|
62
|
+
if (data.size === 's')
|
|
63
|
+
return `${flattenToAppURL(
|
|
64
|
+
data.url,
|
|
65
|
+
)}/@@images/image/mini`;
|
|
57
66
|
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
data.url,
|
|
61
|
-
)}/@@images/image/preview`;
|
|
62
|
-
if (data.size === 's')
|
|
63
|
-
return `${flattenToAppURL(
|
|
64
|
-
data.url,
|
|
65
|
-
)}/@@images/image/mini`;
|
|
66
|
-
return `${flattenToAppURL(data.url)}/@@images/image`;
|
|
67
|
-
})()
|
|
68
|
-
: data.url
|
|
67
|
+
})()
|
|
68
|
+
: data.url
|
|
69
69
|
}
|
|
70
70
|
sizes={config.blocks.blocksConfig.image.getSizes(data)}
|
|
71
71
|
alt={data.alt || ''}
|
|
@@ -67,19 +67,19 @@ export default function withQuerystringResults(WrappedComponent) {
|
|
|
67
67
|
const totalPages = showAsFolderListing
|
|
68
68
|
? Math.ceil(content.items_total / b_size)
|
|
69
69
|
: showAsQueryListing
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
? Math.ceil(querystringResults[subrequestID].total / b_size)
|
|
71
|
+
: 0;
|
|
72
72
|
|
|
73
73
|
const prevBatch = showAsFolderListing
|
|
74
74
|
? content.batching?.prev
|
|
75
75
|
: showAsQueryListing
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
? querystringResults[subrequestID].batching?.prev
|
|
77
|
+
: null;
|
|
78
78
|
const nextBatch = showAsFolderListing
|
|
79
79
|
? content.batching?.next
|
|
80
80
|
: showAsQueryListing
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
? querystringResults[subrequestID].batching?.next
|
|
82
|
+
: null;
|
|
83
83
|
|
|
84
84
|
const isImageGallery =
|
|
85
85
|
(!data.variation && data.template === 'imageGallery') ||
|
|
@@ -144,8 +144,8 @@ const Facets = (props) => {
|
|
|
144
144
|
? intl.formatMessage(messages.showFilters)
|
|
145
145
|
: intl.formatMessage(messages.moreFilters)
|
|
146
146
|
: advancedFilters === 2
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
? intl.formatMessage(messages.hideFilters)
|
|
148
|
+
: intl.formatMessage(messages.lessFilters)}
|
|
149
149
|
</Button>
|
|
150
150
|
</Grid.Column>
|
|
151
151
|
)}
|
|
@@ -48,8 +48,8 @@ export const customSelectStyles = {
|
|
|
48
48
|
color: state.isSelected
|
|
49
49
|
? '#007bc1'
|
|
50
50
|
: state.isFocused
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
? '#4a4a4a'
|
|
52
|
+
: 'inherit',
|
|
53
53
|
':active': {
|
|
54
54
|
backgroundColor: null,
|
|
55
55
|
},
|
|
@@ -98,8 +98,8 @@ export const sortOnSelectStyles = {
|
|
|
98
98
|
color: state.isSelected
|
|
99
99
|
? '#007bc1'
|
|
100
100
|
: state.isFocused
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
? '#4a4a4a'
|
|
102
|
+
: 'inherit',
|
|
103
103
|
':active': {
|
|
104
104
|
backgroundColor: null,
|
|
105
105
|
},
|
|
@@ -1989,9 +1989,9 @@ class Contents extends Component {
|
|
|
1989
1989
|
this.state.selected.length === 0
|
|
1990
1990
|
? checkboxUncheckedSVG
|
|
1991
1991
|
: this.state.selected.length ===
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1992
|
+
this.state.items.length
|
|
1993
|
+
? checkboxCheckedSVG
|
|
1994
|
+
: checkboxIndeterminateSVG
|
|
1995
1995
|
}
|
|
1996
1996
|
color={
|
|
1997
1997
|
this.state.selected.length > 0
|
|
@@ -258,16 +258,16 @@ class GroupsControlpanel extends Component {
|
|
|
258
258
|
entry.id === name && !entry.roles.includes(value)
|
|
259
259
|
? [...entry.roles, value]
|
|
260
260
|
: entry.id !== name
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
? entry.roles
|
|
262
|
+
: pull(entry.roles, value),
|
|
263
263
|
})),
|
|
264
264
|
authenticatedRole:
|
|
265
265
|
name === 'AuthenticatedUsers' &&
|
|
266
266
|
!prevState.authenticatedRole.includes(value)
|
|
267
267
|
? [...prevState.authenticatedRole, value]
|
|
268
268
|
: name !== 'AuthenticatedUsers'
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
? prevState.authenticatedRole
|
|
270
|
+
: pull(prevState.authenticatedRole, value),
|
|
271
271
|
}));
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
@@ -338,8 +338,8 @@ class UsersControlpanel extends Component {
|
|
|
338
338
|
entry.id === name && !entry.roles.includes(value)
|
|
339
339
|
? [...entry.roles, value]
|
|
340
340
|
: entry.id !== name
|
|
341
|
-
|
|
342
|
-
|
|
341
|
+
? entry.roles
|
|
342
|
+
: pull(entry.roles, value),
|
|
343
343
|
})),
|
|
344
344
|
});
|
|
345
345
|
}
|
|
@@ -104,27 +104,27 @@ class ObjectBrowserBody extends Component {
|
|
|
104
104
|
this.props.mode === 'multiple'
|
|
105
105
|
? '/'
|
|
106
106
|
: this.props.mode === 'image' && this.props.data?.url
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
? getParentURL(this.props.data.url)
|
|
108
|
+
: '/',
|
|
109
109
|
currentLinkFolder:
|
|
110
110
|
this.props.mode === 'multiple'
|
|
111
111
|
? '/'
|
|
112
112
|
: this.props.mode === 'link' && this.props.data?.href
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
? getParentURL(this.props.data.href)
|
|
114
|
+
: '/',
|
|
115
115
|
parentFolder: '',
|
|
116
116
|
selectedImage:
|
|
117
117
|
this.props.mode === 'multiple'
|
|
118
118
|
? ''
|
|
119
119
|
: this.props.mode === 'image' && this.props.data?.url
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
? flattenToAppURL(this.props.data.url)
|
|
121
|
+
: '',
|
|
122
122
|
selectedHref:
|
|
123
123
|
this.props.mode === 'multiple'
|
|
124
124
|
? ''
|
|
125
125
|
: this.props.mode === 'link' && this.props.data?.href
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
? flattenToAppURL(this.props.data.href)
|
|
127
|
+
: '',
|
|
128
128
|
showSearchInput: false,
|
|
129
129
|
// In image mode, the searchable types default to the image types which
|
|
130
130
|
// can be overridden with the property if specified.
|
|
@@ -150,8 +150,8 @@ class ObjectBrowserBody extends Component {
|
|
|
150
150
|
mode === 'multiple'
|
|
151
151
|
? ''
|
|
152
152
|
: mode === 'image'
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
? this.state.selectedImage
|
|
154
|
+
: this.state.selectedHref;
|
|
155
155
|
if (currentSelected && isInternalURL(currentSelected)) {
|
|
156
156
|
this.props.searchContent(
|
|
157
157
|
getParentURL(currentSelected),
|
|
@@ -325,27 +325,27 @@ class ArrayWidget extends Component {
|
|
|
325
325
|
this.props.vocabBaseUrl
|
|
326
326
|
? choices
|
|
327
327
|
: this.props.choices
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
328
|
+
? [
|
|
329
|
+
...choices,
|
|
330
|
+
...(this.props.noValueOption &&
|
|
331
|
+
(this.props.default === undefined ||
|
|
332
|
+
this.props.default === null)
|
|
333
|
+
? [
|
|
334
|
+
{
|
|
335
|
+
label: this.props.intl.formatMessage(
|
|
336
|
+
messages.no_value,
|
|
337
|
+
),
|
|
338
|
+
value: 'no-value',
|
|
339
|
+
},
|
|
340
|
+
]
|
|
341
|
+
: []),
|
|
342
|
+
]
|
|
343
|
+
: [
|
|
344
|
+
{
|
|
345
|
+
label: this.props.intl.formatMessage(messages.no_value),
|
|
346
|
+
value: 'no-value',
|
|
347
|
+
},
|
|
348
|
+
]
|
|
349
349
|
}
|
|
350
350
|
styles={customSelectStyles}
|
|
351
351
|
theme={selectTheme}
|
|
@@ -84,8 +84,8 @@ const FileWidget = (props) => {
|
|
|
84
84
|
const imgsrc = value?.download
|
|
85
85
|
? `${flattenToAppURL(value?.download)}?id=${Date.now()}`
|
|
86
86
|
: null || value?.data
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
? `data:${value['content-type']};${value.encoding},${value.data}`
|
|
88
|
+
: null;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Drop handler
|
|
@@ -445,8 +445,8 @@ class RecurrenceWidget extends Component {
|
|
|
445
445
|
field === 'dtstart'
|
|
446
446
|
? value
|
|
447
447
|
: rruleSet.dtstart()
|
|
448
|
-
|
|
449
|
-
|
|
448
|
+
? rruleSet.dtstart()
|
|
449
|
+
: this.moment().utc().toDate();
|
|
450
450
|
var exdates =
|
|
451
451
|
field === 'exdates' ? value : Object.assign([], rruleSet.exdates());
|
|
452
452
|
|
|
@@ -277,12 +277,12 @@ export default compose(
|
|
|
277
277
|
return props.items?.choices
|
|
278
278
|
? { choices: props.items.choices, lang: state.intl.locale }
|
|
279
279
|
: vocabState
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
280
|
+
? {
|
|
281
|
+
choices: vocabState,
|
|
282
|
+
vocabBaseUrl,
|
|
283
|
+
lang: state.intl.locale,
|
|
284
|
+
}
|
|
285
|
+
: { vocabBaseUrl, lang: state.intl.locale };
|
|
286
286
|
},
|
|
287
287
|
{ getVocabulary, getVocabularyTokenTitle },
|
|
288
288
|
),
|
|
@@ -150,10 +150,10 @@ export const customSelectStyles = {
|
|
|
150
150
|
color: state.isSelected
|
|
151
151
|
? '#007bc1'
|
|
152
152
|
: state.isDisabled
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
? '#b5b5b5'
|
|
154
|
+
: state.isFocused
|
|
155
|
+
? '#4a4a4a'
|
|
156
|
+
: 'inherit',
|
|
157
157
|
':active': {
|
|
158
158
|
backgroundColor: null,
|
|
159
159
|
},
|
|
@@ -24,8 +24,8 @@ const BooleanWidget = ({ value, children, className, intl }) => {
|
|
|
24
24
|
: intl.formatMessage(messages.no),
|
|
25
25
|
)
|
|
26
26
|
: value
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
? intl.formatMessage(messages.yes)
|
|
28
|
+
: intl.formatMessage(messages.no)}
|
|
29
29
|
</span>
|
|
30
30
|
) : (
|
|
31
31
|
''
|
package/src/config/Loadables.jsx
CHANGED
|
@@ -39,22 +39,22 @@ export const loadables = {
|
|
|
39
39
|
// draftjs libs
|
|
40
40
|
immutableLib: loadable.lib(() => import('immutable')),
|
|
41
41
|
draftJs: loadable.lib(() => import('draft-js')),
|
|
42
|
-
draftJsLibIsSoftNewlineEvent: loadable.lib(
|
|
43
|
-
import('draft-js/lib/isSoftNewlineEvent'),
|
|
42
|
+
draftJsLibIsSoftNewlineEvent: loadable.lib(
|
|
43
|
+
() => import('draft-js/lib/isSoftNewlineEvent'),
|
|
44
44
|
),
|
|
45
45
|
draftJsFilters: loadable.lib(() => import('draftjs-filters')),
|
|
46
|
-
draftJsInlineToolbarPlugin: loadable.lib(
|
|
47
|
-
import('draft-js-inline-toolbar-plugin'),
|
|
46
|
+
draftJsInlineToolbarPlugin: loadable.lib(
|
|
47
|
+
() => import('draft-js-inline-toolbar-plugin'),
|
|
48
48
|
),
|
|
49
49
|
draftJsImportHtml: loadable.lib(() => import('draft-js-import-html')),
|
|
50
|
-
draftJsBlockBreakoutPlugin: loadable.lib(
|
|
51
|
-
import('draft-js-block-breakout-plugin'),
|
|
50
|
+
draftJsBlockBreakoutPlugin: loadable.lib(
|
|
51
|
+
() => import('draft-js-block-breakout-plugin'),
|
|
52
52
|
),
|
|
53
|
-
draftJsCreateInlineStyleButton: loadable.lib(
|
|
54
|
-
import('draft-js-buttons/lib/utils/createInlineStyleButton'),
|
|
53
|
+
draftJsCreateInlineStyleButton: loadable.lib(
|
|
54
|
+
() => import('draft-js-buttons/lib/utils/createInlineStyleButton'),
|
|
55
55
|
),
|
|
56
|
-
draftJsCreateBlockStyleButton: loadable.lib(
|
|
57
|
-
import('draft-js-buttons/lib/utils/createBlockStyleButton'),
|
|
56
|
+
draftJsCreateBlockStyleButton: loadable.lib(
|
|
57
|
+
() => import('draft-js-buttons/lib/utils/createBlockStyleButton'),
|
|
58
58
|
),
|
|
59
59
|
draftJsPluginsUtils: loadable.lib(() => import('draft-js-plugins-utils')),
|
|
60
60
|
};
|
package/src/config/Views.jsx
CHANGED
|
@@ -18,8 +18,8 @@ import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorize
|
|
|
18
18
|
import Forbidden from '@plone/volto/components/theme/Forbidden/Forbidden';
|
|
19
19
|
import ServerError from '@plone/volto/components/theme/Error/ServerError';
|
|
20
20
|
|
|
21
|
-
const EventView = loadable(
|
|
22
|
-
import('@plone/volto/components/theme/View/EventView'),
|
|
21
|
+
const EventView = loadable(
|
|
22
|
+
() => import('@plone/volto/components/theme/View/EventView'),
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
defineMessages({
|
package/src/config/Widgets.jsx
CHANGED
|
@@ -55,13 +55,14 @@ import TitleViewWidget from '@plone/volto/components/theme/Widgets/TitleWidget';
|
|
|
55
55
|
import TokenViewWidget from '@plone/volto/components/theme/Widgets/TokenWidget';
|
|
56
56
|
import UrlViewWidget from '@plone/volto/components/theme/Widgets/UrlWidget';
|
|
57
57
|
|
|
58
|
-
export const DatetimeWidget = loadable(
|
|
59
|
-
import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
|
|
58
|
+
export const DatetimeWidget = loadable(
|
|
59
|
+
() => import('@plone/volto/components/manage/Widgets/DatetimeWidget'),
|
|
60
60
|
);
|
|
61
|
-
export const RecurrenceWidget = loadable(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
export const RecurrenceWidget = loadable(
|
|
62
|
+
() =>
|
|
63
|
+
import(
|
|
64
|
+
'@plone/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget'
|
|
65
|
+
),
|
|
65
66
|
);
|
|
66
67
|
|
|
67
68
|
// Widgets mapping
|
|
@@ -483,26 +483,26 @@ export function applySchemaDefaults({ data = {}, schema, intl }) {
|
|
|
483
483
|
[currentField]: schema.properties[currentField].default,
|
|
484
484
|
}
|
|
485
485
|
: intl &&
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
486
|
+
schema.properties[currentField].schema &&
|
|
487
|
+
!(schema.properties[currentField].widget === 'object_list') // TODO: this should be renamed as itemSchema
|
|
488
|
+
? {
|
|
489
|
+
...accumulator,
|
|
490
|
+
[currentField]: {
|
|
491
|
+
...applySchemaDefaults({
|
|
492
|
+
data: { ...data[currentField], ...accumulator[currentField] },
|
|
493
|
+
schema:
|
|
494
|
+
typeof schema.properties[currentField].schema === 'function'
|
|
495
|
+
? schema.properties[currentField].schema({
|
|
496
|
+
data: accumulator[currentField],
|
|
497
|
+
formData: accumulator[currentField],
|
|
498
|
+
intl,
|
|
499
|
+
})
|
|
500
|
+
: schema.properties[currentField].schema,
|
|
501
|
+
intl,
|
|
502
|
+
}),
|
|
503
|
+
},
|
|
504
|
+
}
|
|
505
|
+
: accumulator;
|
|
506
506
|
}, {}),
|
|
507
507
|
data,
|
|
508
508
|
);
|
|
@@ -143,8 +143,8 @@ class Html extends Component {
|
|
|
143
143
|
rel: !criticalCss
|
|
144
144
|
? elem.props.rel
|
|
145
145
|
: elem.props.as === 'style'
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
? 'prefetch'
|
|
147
|
+
: elem.props.rel,
|
|
148
148
|
}),
|
|
149
149
|
)}
|
|
150
150
|
{/* Styles in development are loaded with Webpack's style-loader, in production,
|
|
@@ -42,10 +42,10 @@ export function formatDate({
|
|
|
42
42
|
format = format
|
|
43
43
|
? format
|
|
44
44
|
: long && !includeTime
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
? long_date_format
|
|
46
|
+
: includeTime
|
|
47
|
+
? short_date_and_time_format
|
|
48
|
+
: short_date_format;
|
|
49
49
|
|
|
50
50
|
const formatter = new Intl.DateTimeFormat(locale, format);
|
|
51
51
|
return formatToParts
|
|
@@ -94,6 +94,6 @@ export function formatRelativeDate({
|
|
|
94
94
|
return isNaN(v)
|
|
95
95
|
? ''
|
|
96
96
|
: formatToParts
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
? formatter.formatToParts(v, tag)
|
|
98
|
+
: formatter.format(v, tag).replace('\u202F', ' '); // use "now" ?
|
|
99
99
|
}
|
|
@@ -136,8 +136,8 @@ export const getColor = (name) => {
|
|
|
136
136
|
const namedColor = namedColors[name]
|
|
137
137
|
? namedColors[name]
|
|
138
138
|
: safeColors.length > 0
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
? safeColors.pop()
|
|
140
|
+
: `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
141
141
|
if (!namedColors[name]) {
|
|
142
142
|
namedColors[name] = namedColor;
|
|
143
143
|
}
|
package/src/store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
|
-
import { composeWithDevTools } from 'redux-devtools
|
|
3
|
+
import { composeWithDevTools } from '@redux-devtools/extension';
|
|
4
4
|
import { connectRouter, routerMiddleware } from 'connected-react-router';
|
|
5
5
|
import { save, load } from 'redux-localstorage-simple';
|
|
6
6
|
|