@plone/volto 17.0.0-alpha.22 → 17.0.0-alpha.24

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 (41) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +28 -1
  3. package/locales/ca/LC_MESSAGES/volto.po +32 -0
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +32 -0
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +32 -0
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +32 -0
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +32 -0
  12. package/locales/eu.json +1 -1
  13. package/locales/fi/LC_MESSAGES/volto.po +32 -0
  14. package/locales/fi.json +1 -1
  15. package/locales/fr/LC_MESSAGES/volto.po +32 -0
  16. package/locales/fr.json +1 -1
  17. package/locales/it/LC_MESSAGES/volto.po +32 -0
  18. package/locales/it.json +1 -1
  19. package/locales/ja/LC_MESSAGES/volto.po +32 -0
  20. package/locales/ja.json +1 -1
  21. package/locales/nl/LC_MESSAGES/volto.po +32 -0
  22. package/locales/nl.json +1 -1
  23. package/locales/pt/LC_MESSAGES/volto.po +32 -0
  24. package/locales/pt.json +1 -1
  25. package/locales/pt_BR/LC_MESSAGES/volto.po +32 -0
  26. package/locales/pt_BR.json +1 -1
  27. package/locales/ro/LC_MESSAGES/volto.po +32 -0
  28. package/locales/ro.json +1 -1
  29. package/locales/volto.pot +33 -1
  30. package/locales/zh_CN/LC_MESSAGES/volto.po +32 -0
  31. package/locales/zh_CN.json +1 -1
  32. package/package.json +2 -2
  33. package/package.json~ +444 -0
  34. package/packages/volto-slate/package.json +1 -1
  35. package/src/components/manage/Blocks/Container/EditBlockWrapper.jsx +1 -1
  36. package/src/components/manage/Blocks/Grid/Edit.jsx +3 -1
  37. package/src/components/manage/Blocks/ToC/Schema.jsx +36 -7
  38. package/src/components/theme/Error/ServerError.jsx +29 -0
  39. package/src/config/Views.jsx +2 -0
  40. package/src/middleware/api.js +14 -2
  41. package/theme/themes/pastanaga/extras/blocks.less +1 -1
package/package.json~ ADDED
@@ -0,0 +1,444 @@
1
+ {
2
+ "name": "@plone/volto",
3
+ "description": "Volto",
4
+ "maintainers": [
5
+ {
6
+ "name": "Plone Foundation",
7
+ "email": "plone-developers@lists.sourceforge.net",
8
+ "url": "http://plone.org"
9
+ }
10
+ ],
11
+ "license": "MIT",
12
+ "version": "17.0.0-alpha.23",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git@github.com:plone/volto.git"
16
+ },
17
+ "customizationPaths": [
18
+ "src/customizations/"
19
+ ],
20
+ "bugs": {
21
+ "url": "https://github.com/plone/volto/issues",
22
+ "email": "plone-developers@lists.sourceforge.net"
23
+ },
24
+ "homepage": "https://plone.org",
25
+ "keywords": [
26
+ "volto",
27
+ "plone",
28
+ "react"
29
+ ],
30
+ "packagesFolderAddons": {
31
+ "volto-slate": {
32
+ "package": "@plone/volto-slate"
33
+ }
34
+ },
35
+ "scripts": {
36
+ "postinstall": "make patches",
37
+ "analyze": "BUNDLE_ANALYZE=true razzle build",
38
+ "start": "razzle start",
39
+ "start:coresandbox": "ADDONS=coresandbox razzle start",
40
+ "build": "razzle build --noninteractive",
41
+ "prepare": "husky install",
42
+ "test": "razzle test --maxWorkers=50%",
43
+ "test:ci": "CI=true NODE_ICU_DATA=node_modules/full-icu razzle test",
44
+ "test:husky": "CI=true yarn test --bail --findRelatedTests",
45
+ "test:debug": "node --inspect node_modules/.bin/jest --runInBand",
46
+ "start:prod": "NODE_ENV=production node build/server.js",
47
+ "prettier": "./node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,ts,tsx,json}'",
48
+ "prettier:fix": "./node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,ts,tsx,json}'",
49
+ "stylelint": "./node_modules/.bin/stylelint 'theme/**/*.{css,less}' 'src/**/*.{css,less}'",
50
+ "stylelint:overrides": "./node_modules/.bin/stylelint 'theme/**/*.overrides' 'src/**/*.overrides'",
51
+ "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
52
+ "lint": "./node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx,json}'",
53
+ "lint:fix": "./node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx,json}'",
54
+ "i18n": "rm -rf build/messages && NODE_ENV=production i18n",
55
+ "i18n:ci": "yarn i18n && git diff -G'^[^\"POT]' --exit-code",
56
+ "dry-release": "release-it --dry-run",
57
+ "release": "release-it",
58
+ "release-major-alpha": "release-it major --preRelease=alpha",
59
+ "release-alpha": "release-it --preRelease=alpha",
60
+ "storybook": "start-storybook -p 6006",
61
+ "build-storybook": "build-storybook"
62
+ },
63
+ "bundlewatch": {
64
+ "files": [
65
+ {
66
+ "path": "build/public/static/js/*.js",
67
+ "maxSize": "700kB"
68
+ }
69
+ ]
70
+ },
71
+ "jest": {
72
+ "modulePathIgnorePatterns": [
73
+ "api",
74
+ "packages"
75
+ ],
76
+ "transform": {
77
+ "^.+\\.js(x)?$": "babel-jest",
78
+ "^.+\\.(png)$": "jest-file",
79
+ "^.+\\.(jpg)$": "jest-file",
80
+ "^.+\\.(svg)$": "./jest-svgsystem-transform.js"
81
+ },
82
+ "moduleNameMapper": {
83
+ "@plone/volto/package.json": "<rootDir>/package.json",
84
+ "@plone/volto/babel": "<rootDir>/babel.js",
85
+ "@plone/volto/(.*)$": "<rootDir>/src/$1",
86
+ "@plone/volto-slate/(.*)$": "<rootDir>/packages/volto-slate/src/$1",
87
+ "~/config": "<rootDir>/src/config",
88
+ "~/../locales/${lang}.json": "<rootDir>/locales/en.json",
89
+ "(.*)/locales/(.*)": "<rootDir>/locales/$2",
90
+ "load-volto-addons": "<rootDir>/jest-addons-loader.js",
91
+ "@package/(.*)$": "<rootDir>/src/$1",
92
+ "@root/config": "<rootDir>/jest-addons-loader.js",
93
+ "@root/(.*)$": "<rootDir>/src/$1",
94
+ "@voltoconfig": "<rootDir>/jest-addons-loader.js",
95
+ "\\.(css|less|scss|sass)$": "identity-obj-proxy"
96
+ },
97
+ "coverageThreshold": {
98
+ "global": {
99
+ "branches": 10,
100
+ "functions": 10,
101
+ "lines": 10,
102
+ "statements": 10
103
+ }
104
+ },
105
+ "setupFiles": [
106
+ "./test-setup-globals.js",
107
+ "./test-setup-config.js"
108
+ ],
109
+ "globalSetup": "./global-test-setup.js",
110
+ "globals": {
111
+ "__DEV__": true
112
+ },
113
+ "testMatch": [
114
+ "<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
115
+ "<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}",
116
+ "<rootDir>/__tests__/**/?(*.)(spec|test).{js,jsx,mjs}",
117
+ "<rootDir>/packages/volto-slate/src/**/?(*.)(spec|test).{js,jsx,mjs}"
118
+ ]
119
+ },
120
+ "prettier": {
121
+ "trailingComma": "all",
122
+ "singleQuote": true,
123
+ "overrides": [
124
+ {
125
+ "files": "*.overrides",
126
+ "options": {
127
+ "parser": "less"
128
+ }
129
+ }
130
+ ]
131
+ },
132
+ "stylelint": {
133
+ "extends": [
134
+ "stylelint-config-idiomatic-order"
135
+ ],
136
+ "plugins": [
137
+ "stylelint-prettier"
138
+ ],
139
+ "overrides": [
140
+ {
141
+ "files": [
142
+ "**/*.scss"
143
+ ],
144
+ "customSyntax": "postcss-scss"
145
+ },
146
+ {
147
+ "files": [
148
+ "**/*.less"
149
+ ],
150
+ "customSyntax": "postcss-less"
151
+ },
152
+ {
153
+ "files": [
154
+ "**/*.overrides"
155
+ ],
156
+ "customSyntax": "postcss-less"
157
+ }
158
+ ],
159
+ "rules": {
160
+ "prettier/prettier": true,
161
+ "rule-empty-line-before": [
162
+ "always-multi-line",
163
+ {
164
+ "except": [
165
+ "first-nested"
166
+ ],
167
+ "ignore": [
168
+ "after-comment"
169
+ ]
170
+ }
171
+ ]
172
+ },
173
+ "ignoreFiles": "theme/themes/default/**/*.overrides"
174
+ },
175
+ "browserslist": [
176
+ ">1%",
177
+ "last 4 versions",
178
+ "Firefox ESR",
179
+ "not ie 11",
180
+ "not dead"
181
+ ],
182
+ "release-it": {
183
+ "hooks": {
184
+ "before:bump": [
185
+ "yarn i18n",
186
+ "git add locales"
187
+ ],
188
+ "after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version} && make corepackagebump VERSION=${version}",
189
+ "after:release": "rm .changelog.draft"
190
+ },
191
+ "git": {
192
+ "changelog": "pipx run towncrier build --draft --yes --version 0.0.0",
193
+ "requireUpstream": false,
194
+ "requireCleanWorkingDir": false
195
+ },
196
+ "github": {
197
+ "release": true,
198
+ "releaseName": "${version}",
199
+ "releaseNotes": "cat .changelog.draft"
200
+ }
201
+ },
202
+ "lint-staged": {
203
+ "src/**/*.{js,jsx,ts,tsx,json}": [
204
+ "npx eslint --max-warnings=0 --fix",
205
+ "npx prettier --single-quote --write",
206
+ "yarn test:husky"
207
+ ],
208
+ "src/**/*.{jsx}": [
209
+ "yarn i18n"
210
+ ],
211
+ "theme/**/*.{css,less}": [
212
+ "npx stylelint --fix"
213
+ ],
214
+ "src/**/*.{css,less}": [
215
+ "npx stylelint --fix"
216
+ ],
217
+ "theme/**/*.overrides": [
218
+ "npx stylelint --fix"
219
+ ],
220
+ "src/**/*.overrides": [
221
+ "npx stylelint --fix"
222
+ ]
223
+ },
224
+ "engines": {
225
+ "node": "^16 || ^18"
226
+ },
227
+ "dependencies": {
228
+ "@babel/core": "^7.0.0",
229
+ "@babel/plugin-proposal-export-default-from": "7.18.9",
230
+ "@babel/plugin-proposal-export-namespace-from": "7.18.9",
231
+ "@babel/plugin-proposal-json-strings": "7.18.6",
232
+ "@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
233
+ "@babel/plugin-proposal-throw-expressions": "7.18.6",
234
+ "@babel/plugin-syntax-export-namespace-from": "7.8.3",
235
+ "@babel/runtime": "7.20.6",
236
+ "@babel/types": "7.20.5",
237
+ "@loadable/babel-plugin": "5.13.2",
238
+ "@loadable/component": "5.14.1",
239
+ "@loadable/server": "5.14.0",
240
+ "@loadable/webpack-plugin": "5.15.2",
241
+ "@plone/scripts": "2.1.2",
242
+ "@testing-library/cypress": "9.0.0",
243
+ "@testing-library/jest-dom": "5.16.4",
244
+ "@testing-library/react": "12.1.5",
245
+ "@testing-library/react-hooks": "8.0.1",
246
+ "autoprefixer": "10.4.8",
247
+ "axe-core": "4.4.2",
248
+ "babel-eslint": "10.1.0",
249
+ "babel-plugin-add-module-exports": "0.2.1",
250
+ "babel-plugin-lodash": "3.3.4",
251
+ "babel-plugin-react-intl": "5.1.17",
252
+ "babel-plugin-root-import": "6.1.0",
253
+ "babel-preset-razzle": "4.2.17",
254
+ "circular-dependency-plugin": "5.2.2",
255
+ "classnames": "2.2.6",
256
+ "commander": "8.2.0",
257
+ "connected-react-router": "6.8.0",
258
+ "crypto-random-string": "3.2.0",
259
+ "css-loader": "5.2.7",
260
+ "cypress": "12.17.1",
261
+ "cypress-axe": "1.4.0",
262
+ "cypress-file-upload": "5.0.8",
263
+ "debug": "4.3.2",
264
+ "decorate-component-with-props": "1.2.1",
265
+ "deep-freeze": "0.0.1",
266
+ "dependency-graph": "0.10.0",
267
+ "detect-browser": "5.1.0",
268
+ "diff": "3.5.0",
269
+ "draft-js": "0.10.5",
270
+ "draft-js-block-breakout-plugin": "2.0.1",
271
+ "draft-js-buttons": "2.0.2",
272
+ "draft-js-import-html": "1.4.1",
273
+ "draft-js-inline-toolbar-plugin": "2.0.3",
274
+ "draft-js-plugins-editor": "2.1.1",
275
+ "draft-js-plugins-utils": "2.0.3",
276
+ "draftjs-filters": "2.3.0",
277
+ "eslint": "6.8.0",
278
+ "eslint-config-airbnb": "18.1.0",
279
+ "eslint-config-prettier": "6.11.0",
280
+ "eslint-config-react-app": "5.2.1",
281
+ "eslint-import-resolver-alias": "1.1.2",
282
+ "eslint-import-resolver-babel-plugin-root-import": "1.1.1",
283
+ "eslint-plugin-flowtype": "4.7.0",
284
+ "eslint-plugin-import": "2.20.2",
285
+ "eslint-plugin-jsx-a11y": "6.2.3",
286
+ "eslint-plugin-prettier": "3.1.3",
287
+ "eslint-plugin-react": "7.20.0",
288
+ "eslint-plugin-react-hooks": "4.0.2",
289
+ "express": "4.17.3",
290
+ "filesize": "6",
291
+ "github-slugger": "1.4.0",
292
+ "glob": "7.1.6",
293
+ "history": "4.10.1",
294
+ "hoist-non-react-statics": "3.3.2",
295
+ "html-webpack-plugin": "5.5.0",
296
+ "http-proxy-middleware": "2.0.1",
297
+ "husky": "8.0.1",
298
+ "identity-obj-proxy": "3.0.0",
299
+ "image-extensions": "1.1.0",
300
+ "immutable": "3",
301
+ "is-hotkey": "0.2.0",
302
+ "is-url": "1.2.4",
303
+ "jest-file": "1.0.0",
304
+ "jotai": "2.0.3",
305
+ "jwt-decode": "2.2.0",
306
+ "less": "3.11.1",
307
+ "less-loader": "11.1.0",
308
+ "linkify-it": "3.0.2",
309
+ "lint-staged": "10.2.2",
310
+ "locale": "0.1.0",
311
+ "lodash": "4.17.21",
312
+ "lodash-move": "1.1.1",
313
+ "lodash-webpack-plugin": "0.11.6",
314
+ "mini-css-extract-plugin": "2.7.2",
315
+ "moment": "2.29.4",
316
+ "object-assign": "4.1.1",
317
+ "pofile": "1.0.10",
318
+ "postcss": "8.4.13",
319
+ "postcss-flexbugs-fixes": "5.0.2",
320
+ "postcss-less": "6.0.0",
321
+ "postcss-load-config": "3.1.4",
322
+ "postcss-loader": "7.0.2",
323
+ "postcss-overrides": "3.1.4",
324
+ "postcss-scss": "4.0.6",
325
+ "prepend-http": "2",
326
+ "prettier": "2.0.5",
327
+ "pretty-bytes": "5.3.0",
328
+ "prismjs": "1.27.0",
329
+ "promise-file-reader": "1.0.2",
330
+ "prop-types": "15.7.2",
331
+ "query-string": "7.1.0",
332
+ "razzle": "4.2.18",
333
+ "razzle-dev-utils": "4.2.18",
334
+ "razzle-plugin-bundle-analyzer": "4.2.18",
335
+ "razzle-plugin-scss": "4.2.18",
336
+ "rc-time-picker": "3.7.3",
337
+ "react": "17.0.2",
338
+ "react-anchor-link-smooth-scroll": "1.0.12",
339
+ "react-animate-height": "2.0.17",
340
+ "react-beautiful-dnd": "13.0.0",
341
+ "react-cookie": "4.1.1",
342
+ "react-dates": "21.5.1",
343
+ "react-detect-click-outside": "1.1.1",
344
+ "react-dnd": "5.0.0",
345
+ "react-dnd-html5-backend": "5.0.1",
346
+ "react-dom": "17.0.2",
347
+ "react-dropzone": "11.1.0",
348
+ "react-fast-compare": "2.0.4",
349
+ "react-image-gallery": "1.2.7",
350
+ "react-intersection-observer": "9.1.0",
351
+ "react-intl": "3.8.0",
352
+ "react-intl-redux": "2.2.0",
353
+ "react-medium-image-zoom": "3.0.15",
354
+ "react-portal": "4.2.1",
355
+ "react-redux": "7.2.4",
356
+ "react-router": "5.2.0",
357
+ "react-router-config": "5.1.1",
358
+ "react-router-dom": "5.2.0",
359
+ "react-router-hash-link": "2.4.3",
360
+ "react-select": "4.3.1",
361
+ "react-select-async-paginate": "0.5.3",
362
+ "react-share": "2.3.1",
363
+ "react-side-effect": "2.1.0",
364
+ "react-simple-code-editor": "0.7.1",
365
+ "react-sortable-hoc": "2.0.0",
366
+ "react-test-renderer": "17.0.2",
367
+ "react-toastify": "5.4.1",
368
+ "react-transition-group": "4.4.5",
369
+ "react-virtualized": "9.22.3",
370
+ "redraft": "0.10.2",
371
+ "redux": "4.1.0",
372
+ "redux-actions": "2.6.5",
373
+ "redux-connect": "10.0.0",
374
+ "redux-devtools-extension": "2.13.8",
375
+ "redux-localstorage-simple": "2.3.1",
376
+ "redux-mock-store": "1.5.4",
377
+ "redux-thunk": "2.3.0",
378
+ "rrule": "2.7.1",
379
+ "semantic-ui-less": "2.4.1",
380
+ "semantic-ui-react": "2.0.3",
381
+ "serialize-javascript": "3.1.0",
382
+ "slate": "0.84.0",
383
+ "slate-hyperscript": "0.81.3",
384
+ "slate-react": "0.83.2",
385
+ "start-server-and-test": "1.14.0",
386
+ "style-loader": "3.3.1",
387
+ "stylelint": "14.0.1",
388
+ "stylelint-config-idiomatic-order": "8.1.0",
389
+ "stylelint-config-prettier": "8.0.1",
390
+ "stylelint-prettier": "1.1.2",
391
+ "superagent": "3.8.2",
392
+ "svg-loader": "0.0.2",
393
+ "svgo-loader": "3.0.3",
394
+ "terser-webpack-plugin": "5.3.6",
395
+ "tlds": "1.203.1",
396
+ "undoo": "0.5.0",
397
+ "universal-cookie": "4.0.4",
398
+ "universal-cookie-express": "4.0.3",
399
+ "use-deep-compare-effect": "1.8.1",
400
+ "uuid": "^8.3.2",
401
+ "webpack": "5.76.1",
402
+ "webpack-dev-server": "4.11.1",
403
+ "webpack-node-externals": "3.0.0",
404
+ "xmlrpc": "1.3.2",
405
+ "yarnhook": "0.5.1"
406
+ },
407
+ "devDependencies": {
408
+ "@storybook/addon-actions": "^6.5.15",
409
+ "@storybook/addon-controls": "6.5.15",
410
+ "@storybook/addon-essentials": "^6.5.15",
411
+ "@storybook/addon-links": "^6.5.15",
412
+ "@storybook/builder-webpack5": "^6.5.15",
413
+ "@storybook/manager-webpack5": "^6.5.15",
414
+ "@storybook/react": "^6.5.15",
415
+ "babel-loader": "9.1.0",
416
+ "bundlewatch": "0.3.3",
417
+ "full-icu": "1.4.0",
418
+ "identity-obj-proxy": "3.0.0",
419
+ "jest": "26.6.3",
420
+ "jest-environment-jsdom": "^26",
421
+ "jsonwebtoken": "9.0.0",
422
+ "react-error-overlay": "6.0.9",
423
+ "react-is": "^16.13.1",
424
+ "release-it": "^16.1.3",
425
+ "semver": "^7.5.4",
426
+ "tmp": "0.2.1",
427
+ "use-trace-update": "1.3.2",
428
+ "why": "0.6.2"
429
+ },
430
+ "resolutions-comments": {
431
+ "ua-parser-js": "See https://github.com/faisalman/ua-parser-js/issues/536"
432
+ },
433
+ "resolutions": {
434
+ "clean-css": "5.3.1",
435
+ "http-proxy": "^1.18.1",
436
+ "react-dev-utils": "^12",
437
+ "react-error-overlay": "6.0.9",
438
+ "ua-parser-js": "0.7.28"
439
+ },
440
+ "volta": {
441
+ "node": "18.13.0"
442
+ },
443
+ "packageManager": "yarn@3.2.3"
444
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "17.0.0-alpha.22",
3
+ "version": "17.0.0-alpha.24",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -49,7 +49,7 @@ const EditBlockWrapper = (props) => {
49
49
  role="presentation"
50
50
  className="cell-wrapper"
51
51
  onClick={(e) => {
52
- e.stopPropagation();
52
+ e.block = block;
53
53
  onSelectBlock(block);
54
54
  }}
55
55
  >
@@ -21,7 +21,9 @@ const GridBlockEdit = (props) => {
21
21
  })}
22
22
  // This is required to enabling a small "in-between" clickable area
23
23
  // for bringing the Grid sidebar alive once you have selected an inner block
24
- onClick={(e) => setSelectedBlock(null)}
24
+ onClick={(e) => {
25
+ if (!e.block) setSelectedBlock(null);
26
+ }}
25
27
  role="presentation"
26
28
  >
27
29
  <ContainerEdit
@@ -1,8 +1,37 @@
1
- const TableOfContentsSchema = ({ data }) => {
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ const messages = defineMessages({
4
+ toc: {
5
+ id: 'toc',
6
+ defaultMessage: 'Table of Contents',
7
+ },
8
+ Title: {
9
+ id: 'Title',
10
+ defaultMessage: 'Title',
11
+ },
12
+ HideTitle: {
13
+ id: 'Hide title',
14
+ defaultMessage: 'Hide title',
15
+ },
16
+ Entries: {
17
+ id: 'Entries',
18
+ defaultMessage: 'Entries',
19
+ },
20
+ Ordered: {
21
+ id: 'Ordered',
22
+ defaultMessage: 'Ordered',
23
+ },
24
+ Sticky: {
25
+ id: 'Sticky',
26
+ defaultMessage: 'Sticky',
27
+ },
28
+ });
29
+
30
+ const TableOfContentsSchema = ({ data, intl }) => {
2
31
  const { variation = 'default' } = data;
3
32
 
4
33
  return {
5
- title: 'Table of Contents',
34
+ title: intl.formatMessage(messages.toc),
6
35
  fieldsets: [
7
36
  {
8
37
  id: 'default',
@@ -17,14 +46,14 @@ const TableOfContentsSchema = ({ data }) => {
17
46
  ],
18
47
  properties: {
19
48
  title: {
20
- title: 'Block title',
49
+ title: intl.formatMessage(messages.Title),
21
50
  },
22
51
  hide_title: {
23
- title: 'Hide title',
52
+ title: intl.formatMessage(messages.HideTitle),
24
53
  type: 'boolean',
25
54
  },
26
55
  levels: {
27
- title: 'Entries',
56
+ title: intl.formatMessage(messages.Entries),
28
57
  isMulti: true,
29
58
  choices: [
30
59
  ['h1', 'h1'],
@@ -36,11 +65,11 @@ const TableOfContentsSchema = ({ data }) => {
36
65
  ],
37
66
  },
38
67
  ordered: {
39
- title: 'Ordered',
68
+ title: intl.formatMessage(messages.Ordered),
40
69
  type: 'boolean',
41
70
  },
42
71
  sticky: {
43
- title: 'Sticky',
72
+ title: intl.formatMessage(messages.Sticky),
44
73
  type: 'boolean',
45
74
  },
46
75
  },
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module components/theme/Error/ServerError
3
+ */
4
+
5
+ import React from 'react';
6
+ import { FormattedMessage } from 'react-intl';
7
+ import { Container } from 'semantic-ui-react';
8
+ import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils';
9
+
10
+ /**
11
+ * server error
12
+ * @function ServerError
13
+ * @returns {string} Markup of the server error page.
14
+ */
15
+ const ServerError = () => (
16
+ <Container className="view-wrapper">
17
+ <h1>
18
+ <FormattedMessage id="Server Error" defaultMessage="Server Error" />
19
+ </h1>
20
+ <p className="description">
21
+ <FormattedMessage
22
+ id="We apologize for the inconvenience, but there was an unexpected error on the server."
23
+ defaultMessage="We apologize for the inconvenience, but there was an unexpected error on the server."
24
+ />
25
+ </p>
26
+ </Container>
27
+ );
28
+
29
+ export default withServerErrorCode(500)(ServerError);
@@ -16,6 +16,7 @@ import RequestTimeout from '@plone/volto/components/theme/RequestTimeout/Request
16
16
  import AlbumView from '@plone/volto/components/theme/View/AlbumView';
17
17
  import Unauthorized from '@plone/volto/components/theme/Unauthorized/Unauthorized';
18
18
  import Forbidden from '@plone/volto/components/theme/Forbidden/Forbidden';
19
+ import ServerError from '@plone/volto/components/theme/Error/ServerError';
19
20
 
20
21
  const EventView = loadable(() =>
21
22
  import('@plone/volto/components/theme/View/EventView'),
@@ -114,6 +115,7 @@ export const errorViews = {
114
115
  '401': Unauthorized,
115
116
  '403': Forbidden,
116
117
  '408': RequestTimeout,
118
+ '500': ServerError,
117
119
  ECONNREFUSED: ConnectionRefused,
118
120
  corsError: CorsError,
119
121
  };
@@ -264,10 +264,22 @@ const apiMiddlewareFactory = (api) => ({ dispatch, getState }) => (next) => (
264
264
  };
265
265
  });
266
266
  }
267
- return next({ ...rest, result, type: `${type}_SUCCESS` });
267
+ try {
268
+ return next({ ...rest, result, type: `${type}_SUCCESS` });
269
+ } catch (error) {
270
+ // There was an exception while processing reducers or downstream middleware.
271
+ next({
272
+ ...rest,
273
+ error: { status: 500, error },
274
+ type: `${type}_FAIL`,
275
+ });
276
+ // Rethrow the original exception on the client side only,
277
+ // so it doesn't fall through to express on the server.
278
+ if (__CLIENT__) throw error;
279
+ }
268
280
  },
269
281
  (error) => {
270
- // Only SRR can set ECONNREFUSED
282
+ // Only SSR can set ECONNREFUSED
271
283
  if (error.code === 'ECONNREFUSED') {
272
284
  next({
273
285
  ...rest,
@@ -22,7 +22,7 @@
22
22
 
23
23
  .block .block:not(.inner)::before {
24
24
  position: absolute;
25
- z-index: auto;
25
+ z-index: -1;
26
26
  top: -9px;
27
27
  left: -9px;
28
28
  width: ~'calc(100% + 18px)';