@plone/volto 16.18.0 → 16.20.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.
Files changed (45) hide show
  1. package/.changelog.draft +16 -7
  2. package/.yarn/install-state.gz +0 -0
  3. package/CHANGELOG.md +149 -1
  4. package/addon-registry.js +34 -0
  5. package/create-theme-addons-loader.js +79 -0
  6. package/locales/ca/LC_MESSAGES/volto.po +2 -2
  7. package/locales/de/LC_MESSAGES/volto.po +4 -4
  8. package/locales/de.json +1 -1
  9. package/locales/en/LC_MESSAGES/volto.po +2 -2
  10. package/locales/en.json +1 -1
  11. package/locales/es/LC_MESSAGES/volto.po +2 -2
  12. package/locales/eu/LC_MESSAGES/volto.po +2 -2
  13. package/locales/fi/LC_MESSAGES/volto.po +2 -2
  14. package/locales/fr/LC_MESSAGES/volto.po +2 -2
  15. package/locales/it/LC_MESSAGES/volto.po +2 -2
  16. package/locales/ja/LC_MESSAGES/volto.po +2 -2
  17. package/locales/nl/LC_MESSAGES/volto.po +2 -2
  18. package/locales/pt/LC_MESSAGES/volto.po +2 -2
  19. package/locales/pt_BR/LC_MESSAGES/volto.po +2 -2
  20. package/locales/ro/LC_MESSAGES/volto.po +2 -2
  21. package/locales/volto.pot +3 -3
  22. package/locales/zh_CN/LC_MESSAGES/volto.po +2 -2
  23. package/package.json +1 -1
  24. package/packages/volto-slate/package.json +1 -1
  25. package/pyvenv.cfg +1 -1
  26. package/razzle.config.js +23 -0
  27. package/src/actions/language/language.js +1 -0
  28. package/src/actions/querystringsearch/querystringsearch.js +20 -14
  29. package/src/components/manage/Blocks/Listing/ListingBody.test.jsx +20 -0
  30. package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +1 -2
  31. package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +8 -4
  32. package/src/components/manage/Widgets/SelectUtils.js +1 -1
  33. package/src/components/manage/Widgets/SelectWidget.jsx +1 -1
  34. package/src/components/theme/PasswordReset/PasswordReset.jsx +1 -1
  35. package/src/components/theme/PasswordReset/RequestPasswordReset.jsx +1 -1
  36. package/src/components/theme/View/DefaultView.jsx +1 -1
  37. package/src/config/Widgets.jsx +1 -0
  38. package/src/config/index.js +1 -0
  39. package/src/express-middleware/sitemap.js +0 -1
  40. package/src/helpers/FormValidation/FormValidation.js +10 -1
  41. package/src/helpers/FormValidation/FormValidation.test.js +41 -0
  42. package/src/helpers/Utils/usePagination.js +48 -14
  43. package/src/helpers/Utils/usePagination.test.js +115 -0
  44. package/styles/Vocab/Plone/accept.txt +2 -0
  45. package/styles/Vocab/Plone/reject.txt +5 -0
package/.changelog.draft CHANGED
@@ -1,17 +1,26 @@
1
- ## 16.18.0 (2023-03-22)
1
+ ## 16.20.0 (2023-04-12)
2
2
 
3
3
  ### Feature
4
4
 
5
- - Add Vale to CI for spell and style checks. @MAX-786 [#4423](https://github.com/plone/volto/issues/4423)
5
+ - Support RelationList field with named StaticCatalogVocabulary and SelectWidget. @ksuess [#4614](https://github.com/plone/volto/issues/4614)
6
+ - Support for declaring a theme in `volto.config.js` or in `package.json`
7
+ Add two entry points to allow extension of a theme from other add-ons. @sneridagh [#4625](https://github.com/plone/volto/issues/4625)
8
+ - Added querystring search get option. @robgietema [#4658](https://github.com/plone/volto/issues/4658)
6
9
 
7
10
  ### Bugfix
8
11
 
9
- - Patch updates for some dependencies. @davisagli [#4520](https://github.com/plone/volto/issues/4520)
10
- - InternalURl helper method should incorporate externalRoutes settings into consideration. @iFlameing [#4559](https://github.com/plone/volto/issues/4559)
11
- - Update message add-on control panel: remove 'buildout', update reference. @ksuess [#4574](https://github.com/plone/volto/issues/4574)
12
+ - Added current page parameter to route in listing and search block pagination - Fix: #3868 @bipoza [#4159](https://github.com/plone/volto/issues/4159)
13
+ - Fixed wrong localization on password reset page @iRohitSingh [#4656](https://github.com/plone/volto/issues/4656)
14
+ - fix sitemap.xml.gz not is not compressed @dobri1408 [#4663](https://github.com/plone/volto/issues/4663)
15
+
16
+ ### Internal
17
+
18
+ - Update to p.restapi 8.36.0 and Plone 6.0.3 @sneridagh [#4682](https://github.com/plone/volto/issues/4682)
12
19
 
13
20
  ### Documentation
14
21
 
15
- - Fix broken links at ReactJS.org. @stevepiercy [#4569](https://github.com/plone/volto/issues/4569)
16
- - Fix video warnings and link errors. @stevepiercy [#4578](https://github.com/plone/volto/issues/4578)
22
+ - Update Volto contributing to align with and refer to the new Plone core code contributing requirements. @stevepiercy [#4634](https://github.com/plone/volto/issues/4634)
23
+ - Improve creating views documentation page. @rboixaderg [#4636](https://github.com/plone/volto/issues/4636)
24
+ - Rename "Developer Guidelines" to "Contributing". @stevepiercy [#4666](https://github.com/plone/volto/issues/4666)
25
+ - Fix broken link to `ReactJS.org`. @stevepiercy [#4667](https://github.com/plone/volto/issues/4667)
17
26
 
Binary file
package/CHANGELOG.md CHANGED
@@ -8,6 +8,154 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.20.0 (2023-04-12)
12
+
13
+ ### Feature
14
+
15
+ - Support RelationList field with named StaticCatalogVocabulary and SelectWidget. @ksuess [#4614](https://github.com/plone/volto/issues/4614)
16
+ - Support for declaring a theme in `volto.config.js` or in `package.json`
17
+ Add two entry points to allow extension of a theme from other add-ons. @sneridagh [#4625](https://github.com/plone/volto/issues/4625)
18
+ - Added querystring search get option. @robgietema [#4658](https://github.com/plone/volto/issues/4658)
19
+
20
+ ### Bugfix
21
+
22
+ - Added current page parameter to route in listing and search block pagination - Fix: #3868 @bipoza [#4159](https://github.com/plone/volto/issues/4159)
23
+ - Fixed wrong localization on password reset page @iRohitSingh [#4656](https://github.com/plone/volto/issues/4656)
24
+ - fix sitemap.xml.gz not is not compressed @dobri1408 [#4663](https://github.com/plone/volto/issues/4663)
25
+
26
+ ### Internal
27
+
28
+ - Update to p.restapi 8.36.0 and Plone 6.0.3 @sneridagh [#4682](https://github.com/plone/volto/issues/4682)
29
+
30
+ ### Documentation
31
+
32
+ - Update Volto contributing to align with and refer to the new Plone core code contributing requirements. @stevepiercy [#4634](https://github.com/plone/volto/issues/4634)
33
+ - Improve creating views documentation page. @rboixaderg [#4636](https://github.com/plone/volto/issues/4636)
34
+ - Rename "Developer Guidelines" to "Contributing". @stevepiercy [#4666](https://github.com/plone/volto/issues/4666)
35
+ - Fix broken link to `ReactJS.org`. @stevepiercy [#4667](https://github.com/plone/volto/issues/4667)
36
+
37
+
38
+ ## 17.0.0-alpha.3 (2023-03-22)
39
+
40
+ ### Feature
41
+
42
+ - Add Vale to CI for spell and style checks. @MAX-786 [#4423](https://github.com/plone/volto/issues/4423)
43
+
44
+ ### Bugfix
45
+
46
+ - Fix Search is case sensitive in Block chooser @iRohitSingh [#4526](https://github.com/plone/volto/issues/4526)
47
+ - InternalURl helper method should incorporate externalRoutes settings into consideration. @iFlameing [#4559](https://github.com/plone/volto/issues/4559)
48
+ - Update message add-on control panel: remove 'buildout', update reference. @ksuess [#4574](https://github.com/plone/volto/issues/4574)
49
+
50
+ ### Documentation
51
+
52
+ - Deleted duplicate import and fixed training URLs. @yahya-cloud [#4523](https://github.com/plone/volto/issues/4523)
53
+ - Fix grammar in PR #4542. @stevepiercy [#4555](https://github.com/plone/volto/issues/4555)
54
+ - Fix broken links at `ReactJS.org`. @stevepiercy [#4569](https://github.com/plone/volto/issues/4569)
55
+ - Fix video warnings and link errors. @stevepiercy [#4578](https://github.com/plone/volto/issues/4578)
56
+
57
+
58
+ ## 17.0.0-alpha.2 (2023-03-15)
59
+
60
+ ### Breaking
61
+
62
+ - Add custom CSS animation to hamburger menu. Removed `hamburgers` dependency. @danalvrz [#4433](https://github.com/plone/volto/issues/4433)
63
+ - Improve i18n script ordering of addons, so that addons can override translations from their dependencies. @davisagli [#4495](https://github.com/plone/volto/issues/4495)
64
+
65
+ ### Feature
66
+
67
+ - Add option to hide empty listing blocks @ksuess [#4393](https://github.com/plone/volto/issues/4393)
68
+
69
+ ### Bugfix
70
+
71
+ - Update build dependencies (razzle and react-dev-utils) @davisagli [#3997](https://github.com/plone/volto/issues/3997)
72
+ - Added block prop to BlockDataForm in the Edit component of ToC. If block is not passed, OnChangeBlock will be called with undefined block id. @tedw87 [#4110](https://github.com/plone/volto/issues/4110)
73
+ - Fix focus steal in Form @tedw87 [#4230](https://github.com/plone/volto/issues/4230)
74
+ - Fixed paste issue in Table Block and added cypress test for pasting text in Table Block. [#4301](https://github.com/plone/volto/issues/4301)
75
+ - Fixed i18n script to avoid overwriting translations with an empty msgstr @danalvrz [#4316](https://github.com/plone/volto/issues/4316)
76
+ - bugfix: conditionally render all delete items in confirm widget [#4336](https://github.com/plone/volto/issues/4336)
77
+ - Make the Site Setup control panel responsive for small screen devices. @lord2anil [#4484](https://github.com/plone/volto/issues/4484)
78
+ - The menu for the contents page was unresponsive on mobile devices. Fixed this by changing the menu overflow to scroll. @sudhanshu1309 [#4492](https://github.com/plone/volto/issues/4492)
79
+ - Make Drag and Drop list work with container-type inline-size. @robgietema [#4497](https://github.com/plone/volto/issues/4497)
80
+ - (fix): Paste button disappearing while coping from nested blocks @dobri1408 [#4505](https://github.com/plone/volto/issues/4505)
81
+ - Patch updates for some dependencies. @davisagli [#4520](https://github.com/plone/volto/issues/4520)
82
+ - Fix flaky Cypress test introduced in #4521 @sneridagh [#4522](https://github.com/plone/volto/issues/4522)
83
+
84
+ ### Documentation
85
+
86
+ - Fix training urls @ksuess [#4502](https://github.com/plone/volto/issues/4502)
87
+ - Add upgrade guide for 4504 @sneridagh [#4542](https://github.com/plone/volto/issues/4542)
88
+
89
+
90
+ ## 17.0.0-alpha.1 (2023-03-09)
91
+
92
+ ### Feature
93
+
94
+ - - Add directive to cache stable resources in browser or intermediate server for 365 days by default directly in the SSR Express server, static resource that could change after a new deployment for 1 minute. @mamico [#2216](https://github.com/plone/volto/issues/2216)
95
+ - Use popperjs in BlockChooser, move the markup to the bottom of the body tag. @sneridagh [#4141](https://github.com/plone/volto/issues/4141)
96
+ - Improvements to the dev API proxy:
97
+ - Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
98
+ The target of the API proxy is now always logged on startup, even in production mode.
99
+ - Support proxying to a backend served over https. For this configuration it
100
+ might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
101
+ certificate can't be verified.
102
+
103
+ [davisagli] [#4434](https://github.com/plone/volto/issues/4434)
104
+
105
+ ### Bugfix
106
+
107
+ - fix: newsitem and event views wrapper classNames @nzambello [#4443](https://github.com/plone/volto/issues/4443)
108
+ - Fix weird GHA failure on config option not supported @sneridagh [#4466](https://github.com/plone/volto/issues/4466)
109
+ - Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh [#4471](https://github.com/plone/volto/issues/4471)
110
+ - Fix order of row of long table in edit and view mode @iFlameing [#4473](https://github.com/plone/volto/issues/4473)
111
+ - Improve flaky test in autofocus Cypress tests @sneridagh [#4475](https://github.com/plone/volto/issues/4475)
112
+
113
+ ### Documentation
114
+
115
+ - Complete teaser docs, add new section in `Blocks`: `Core Blocks developers notes` @sneridagh [#4461](https://github.com/plone/volto/issues/4461)
116
+ - Change from links to inline literals in `CHANGELOG.md` to fix linkcheckbroken. @stevepiercy [#4470](https://github.com/plone/volto/issues/4470)
117
+
118
+
119
+ ## 17.0.0-alpha.0 (2023-03-04)
120
+
121
+ ### Breaking
122
+
123
+ - Volto 17 drops support for NodeJS 14, and adds support for NodeJS 18.
124
+ Please see the [upgrade guide](https://6.docs.plone.org/volto/upgrade-guide/index.html)
125
+ for more information.
126
+
127
+ Volto 17 now uses Webpack 5. [#4086](https://github.com/plone/volto/issues/4086)
128
+
129
+ ### Internal
130
+
131
+ - Add HI-ERN website to "Volto in Production" section in README @steffenri [#4172](https://github.com/plone/volto/issues/4172)
132
+
133
+ ### Documentation
134
+
135
+ - Add a new Volto site to the README @erral [#4158](https://github.com/plone/volto/issues/4158), [#4170](https://github.com/plone/volto/issues/4170)
136
+ - Add new websites Lanku and UEU
137
+ [erral] [#4310](https://github.com/plone/volto/issues/4310)
138
+ - Fix English and MyST grammar and syntax from PR #4285 @stevepiercy [#4331](https://github.com/plone/volto/issues/4331)
139
+ - Use a universal static path for both documentation and volto repos. @stevepiercy [#4376](https://github.com/plone/volto/issues/4376)
140
+
141
+
142
+ ## 16.19.0 (2023-04-04)
143
+
144
+ ### Feature
145
+
146
+ - DefaultView (view of fields for content types with blocks disabled): Show field name as tip on hover of label. @ksuess [#4598](https://github.com/plone/volto/issues/4598)
147
+ - Set sameSite in I18N_LANGUAGE cookie @sneridagh [#4627](https://github.com/plone/volto/issues/4627)
148
+
149
+ ### Bugfix
150
+
151
+ - Fix regexp that checks valid URLs and improve tests [cekk] [#4601](https://github.com/plone/volto/issues/4601)
152
+
153
+ ### Documentation
154
+
155
+ - Added `JavaScript` and `NodeJS` as accepted spellings, and deviations of them as rejected spellings. @utkkkarshhh [#3092](https://github.com/plone/volto/issues/3092)
156
+ - Fix documentation build, add pins @sneridagh [#4626](https://github.com/plone/volto/issues/4626)
157
+
158
+
11
159
  ## 16.18.0 (2023-03-22)
12
160
 
13
161
  ### Feature
@@ -22,7 +170,7 @@
22
170
 
23
171
  ### Documentation
24
172
 
25
- - Fix broken links at ReactJS.org. @stevepiercy [#4569](https://github.com/plone/volto/issues/4569)
173
+ - Fix broken links at `ReactJS.org`. @stevepiercy [#4569](https://github.com/plone/volto/issues/4569)
26
174
  - Fix video warnings and link errors. @stevepiercy [#4578](https://github.com/plone/volto/issues/4578)
27
175
 
28
176
 
package/addon-registry.js CHANGED
@@ -130,6 +130,11 @@ class AddonConfigurationRegistry {
130
130
  this.packages = {};
131
131
  this.customizations = new Map();
132
132
 
133
+ // Theme from a package.json key, from volto.config.js or from an ENV VAR
134
+ // Programatically via volto.config.js wins or the ENV VAR if present
135
+ this.theme =
136
+ packageJson.theme || this.voltoConfigJS.theme || process.env.THEME;
137
+
133
138
  this.initDevelopmentPackages();
134
139
  this.initPublishedPackages();
135
140
  this.initAddonsFromEnvVar();
@@ -354,6 +359,35 @@ class AddonConfigurationRegistry {
354
359
  .filter((e) => e);
355
360
  }
356
361
 
362
+ getCustomThemeAddons() {
363
+ const customThemeAddonsInfo = {
364
+ variables: [],
365
+ main: [],
366
+ };
367
+
368
+ this.getAddonDependencies().forEach((addon) => {
369
+ const normalizedAddonName = addon.split(':')[0];
370
+ // We have two possible insertion points, variables and main
371
+
372
+ const customThemeVariables = `${this.packages[normalizedAddonName].modulePath}/theme/_variables.scss`;
373
+ const customThemeMain = `${this.packages[normalizedAddonName].modulePath}/theme/_main.scss`;
374
+ if (
375
+ fs.existsSync(customThemeVariables) &&
376
+ normalizedAddonName !== this.theme
377
+ ) {
378
+ customThemeAddonsInfo.variables.push(normalizedAddonName);
379
+ }
380
+ if (
381
+ fs.existsSync(customThemeMain) &&
382
+ normalizedAddonName !== this.theme
383
+ ) {
384
+ customThemeAddonsInfo.main.push(normalizedAddonName);
385
+ }
386
+ });
387
+
388
+ return customThemeAddonsInfo;
389
+ }
390
+
357
391
  /**
358
392
  * Returns a mapping name:diskpath to be uses in webpack's resolve aliases
359
393
  */
@@ -0,0 +1,79 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const tmp = require('tmp');
4
+ const cryptoRandomString = require('crypto-random-string');
5
+
6
+ const titleCase = (w) => w.slice(0, 1).toUpperCase() + w.slice(1, w.length);
7
+
8
+ /*
9
+ * Transforms a package name to javascript variable name
10
+ */
11
+ function nameFromPackage(name) {
12
+ name =
13
+ name.replace(/[@~./\\:\s]/gi, '') ||
14
+ cryptoRandomString({ length: 10, characters: 'abcdefghijk' });
15
+ return name
16
+ .split('-')
17
+ .map((w, i) => (i > 0 ? titleCase(w) : w))
18
+ .join('');
19
+ }
20
+
21
+ /*
22
+ * Creates a static file with code necessary to load the addons configuration
23
+ *
24
+ */
25
+ function getAddonsLoaderCode(name, customThemeAddons = []) {
26
+ let buf = `/*
27
+ This file is autogenerated. Don't change it directly.
28
+ Add a ./theme/_${name}.scss in your add-on to load your theme customizations in the current theme.
29
+ */
30
+
31
+ `;
32
+ customThemeAddons.forEach((addon) => {
33
+ const customization = `${addon}/theme/${name}`;
34
+ const line = `@import '${customization}';\n`;
35
+ buf += line;
36
+ });
37
+
38
+ return buf;
39
+ }
40
+
41
+ module.exports = ({ main, variables }) => {
42
+ // const addonsThemeLoaderVariablesPath = path.join(
43
+ // process.cwd(),
44
+ // 'src',
45
+ // '_variables.scss',
46
+ // );
47
+ // const addonsThemeLoaderMainPath = path.join(
48
+ // process.cwd(),
49
+ // 'src',
50
+ // '_main.scss',
51
+ // );
52
+
53
+ // const addonsThemeLoaderVariablesPath = path.join(
54
+ // process.cwd(),
55
+ // 'src',
56
+ // '_variables.scss',
57
+ // );
58
+ // const addonsThemeLoaderMainPath = path.join(
59
+ // process.cwd(),
60
+ // 'src',
61
+ // '_main.scss',
62
+ // );
63
+
64
+ const addonsThemeLoaderVariablesPath = tmp.tmpNameSync({ postfix: '.scss' });
65
+ const addonsThemeLoaderMainPath = tmp.tmpNameSync({ postfix: '.scss' });
66
+ fs.writeFileSync(
67
+ addonsThemeLoaderVariablesPath,
68
+ new Buffer.from(getAddonsLoaderCode('variables', variables)),
69
+ );
70
+ fs.writeFileSync(
71
+ addonsThemeLoaderMainPath,
72
+ new Buffer.from(getAddonsLoaderCode('main', main)),
73
+ );
74
+
75
+ return [addonsThemeLoaderVariablesPath, addonsThemeLoaderMainPath];
76
+ };
77
+
78
+ module.exports.getAddonsLoaderCode = getAddonsLoaderCode;
79
+ module.exports.nameFromPackage = nameFromPackage;
@@ -2098,7 +2098,7 @@ msgid "My email is"
2098
2098
  msgstr ""
2099
2099
 
2100
2100
  #: components/theme/PasswordReset/PasswordReset
2101
- # defaultMessage: My username is
2101
+ # defaultMessage: My user name is
2102
2102
  msgid "My username is"
2103
2103
  msgstr "El meu nom d'usuari és"
2104
2104
 
@@ -4193,7 +4193,7 @@ msgid "label_my_email_is"
4193
4193
  msgstr ""
4194
4194
 
4195
4195
  #: components/theme/PasswordReset/RequestPasswordReset
4196
- # defaultMessage: My username is
4196
+ # defaultMessage: My user name is
4197
4197
  msgid "label_my_username_is"
4198
4198
  msgstr "El meu nom d'usuari és"
4199
4199
 
@@ -2095,9 +2095,9 @@ msgid "My email is"
2095
2095
  msgstr "Meine E-Mail ist"
2096
2096
 
2097
2097
  #: components/theme/PasswordReset/PasswordReset
2098
- # defaultMessage: My username is
2098
+ # defaultMessage: My user name is
2099
2099
  msgid "My username is"
2100
- msgstr "Mein Benutzername ist"
2100
+ msgstr "Mein Nutzername lautet"
2101
2101
 
2102
2102
  #: components/manage/Sharing/Sharing
2103
2103
  #: components/theme/ContactForm/ContactForm
@@ -4190,9 +4190,9 @@ msgid "label_my_email_is"
4190
4190
  msgstr "Meine E-Mail ist"
4191
4191
 
4192
4192
  #: components/theme/PasswordReset/RequestPasswordReset
4193
- # defaultMessage: My username is
4193
+ # defaultMessage: My user name is
4194
4194
  msgid "label_my_username_is"
4195
- msgstr "El meu nom d'usuari és"
4195
+ msgstr "Mein Nutzername lautet"
4196
4196
 
4197
4197
  #: config/Blocks
4198
4198
  # defaultMessage: Lead Image Field