@plone/volto 18.33.1 → 18.34.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 (154) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +0 -1
  3. package/locales/af/LC_MESSAGES/volto.po +25 -0
  4. package/locales/af.json +1 -1
  5. package/locales/ar/LC_MESSAGES/volto.po +25 -0
  6. package/locales/ar.json +1 -1
  7. package/locales/bg/LC_MESSAGES/volto.po +25 -0
  8. package/locales/bg.json +1 -1
  9. package/locales/bn/LC_MESSAGES/volto.po +25 -0
  10. package/locales/bn.json +1 -1
  11. package/locales/ca/LC_MESSAGES/volto.po +25 -0
  12. package/locales/ca.json +1 -1
  13. package/locales/cs/LC_MESSAGES/volto.po +25 -0
  14. package/locales/cs.json +1 -1
  15. package/locales/cy/LC_MESSAGES/volto.po +25 -0
  16. package/locales/cy.json +1 -1
  17. package/locales/da/LC_MESSAGES/volto.po +25 -0
  18. package/locales/da.json +1 -1
  19. package/locales/de/LC_MESSAGES/volto.po +25 -0
  20. package/locales/de.json +1 -1
  21. package/locales/el/LC_MESSAGES/volto.po +25 -0
  22. package/locales/el.json +1 -1
  23. package/locales/en/LC_MESSAGES/volto.po +25 -0
  24. package/locales/en.json +1 -1
  25. package/locales/en_AU/LC_MESSAGES/volto.po +25 -0
  26. package/locales/en_AU.json +1 -1
  27. package/locales/en_GB/LC_MESSAGES/volto.po +25 -0
  28. package/locales/en_GB.json +1 -1
  29. package/locales/eo/LC_MESSAGES/volto.po +25 -0
  30. package/locales/eo.json +1 -1
  31. package/locales/es/LC_MESSAGES/volto.po +42 -17
  32. package/locales/es.json +1 -1
  33. package/locales/et/LC_MESSAGES/volto.po +25 -0
  34. package/locales/et.json +1 -1
  35. package/locales/eu/LC_MESSAGES/volto.po +25 -0
  36. package/locales/eu.json +1 -1
  37. package/locales/fa/LC_MESSAGES/volto.po +25 -0
  38. package/locales/fa.json +1 -1
  39. package/locales/fi/LC_MESSAGES/volto.po +25 -0
  40. package/locales/fi.json +1 -1
  41. package/locales/fr/LC_MESSAGES/volto.po +25 -0
  42. package/locales/fr.json +1 -1
  43. package/locales/fu/LC_MESSAGES/volto.po +25 -0
  44. package/locales/fu.json +1 -1
  45. package/locales/gl/LC_MESSAGES/volto.po +30 -5
  46. package/locales/gl.json +1 -1
  47. package/locales/he/LC_MESSAGES/volto.po +25 -0
  48. package/locales/he.json +1 -1
  49. package/locales/hi/LC_MESSAGES/volto.po +25 -0
  50. package/locales/hi.json +1 -1
  51. package/locales/hr/LC_MESSAGES/volto.po +25 -0
  52. package/locales/hr.json +1 -1
  53. package/locales/hu/LC_MESSAGES/volto.po +25 -0
  54. package/locales/hu.json +1 -1
  55. package/locales/hy/LC_MESSAGES/volto.po +25 -0
  56. package/locales/hy.json +1 -1
  57. package/locales/id/LC_MESSAGES/volto.po +25 -0
  58. package/locales/id.json +1 -1
  59. package/locales/it/LC_MESSAGES/volto.po +25 -0
  60. package/locales/it.json +1 -1
  61. package/locales/ja/LC_MESSAGES/volto.po +25 -0
  62. package/locales/ja.json +1 -1
  63. package/locales/ka/LC_MESSAGES/volto.po +25 -0
  64. package/locales/ka.json +1 -1
  65. package/locales/kn/LC_MESSAGES/volto.po +25 -0
  66. package/locales/kn.json +1 -1
  67. package/locales/ko/LC_MESSAGES/volto.po +25 -0
  68. package/locales/ko.json +1 -1
  69. package/locales/lt/LC_MESSAGES/volto.po +25 -0
  70. package/locales/lt.json +1 -1
  71. package/locales/lv/LC_MESSAGES/volto.po +25 -0
  72. package/locales/lv.json +1 -1
  73. package/locales/mi/LC_MESSAGES/volto.po +25 -0
  74. package/locales/mi.json +1 -1
  75. package/locales/mk/LC_MESSAGES/volto.po +25 -0
  76. package/locales/mk.json +1 -1
  77. package/locales/my/LC_MESSAGES/volto.po +25 -0
  78. package/locales/my.json +1 -1
  79. package/locales/nb_NO/LC_MESSAGES/volto.po +25 -0
  80. package/locales/nb_NO.json +1 -1
  81. package/locales/nl/LC_MESSAGES/volto.po +25 -0
  82. package/locales/nl.json +1 -1
  83. package/locales/nn/LC_MESSAGES/volto.po +25 -0
  84. package/locales/nn.json +1 -1
  85. package/locales/pl/LC_MESSAGES/volto.po +25 -0
  86. package/locales/pl.json +1 -1
  87. package/locales/pt/LC_MESSAGES/volto.po +25 -0
  88. package/locales/pt.json +1 -1
  89. package/locales/pt_BR/LC_MESSAGES/volto.po +25 -0
  90. package/locales/pt_BR.json +1 -1
  91. package/locales/rm/LC_MESSAGES/volto.po +25 -0
  92. package/locales/rm.json +1 -1
  93. package/locales/ro/LC_MESSAGES/volto.po +25 -0
  94. package/locales/ro.json +1 -1
  95. package/locales/ru/LC_MESSAGES/volto.po +25 -0
  96. package/locales/ru.json +1 -1
  97. package/locales/sk/LC_MESSAGES/volto.po +25 -0
  98. package/locales/sk.json +1 -1
  99. package/locales/sl/LC_MESSAGES/volto.po +25 -0
  100. package/locales/sl.json +1 -1
  101. package/locales/sm/LC_MESSAGES/volto.po +25 -0
  102. package/locales/sm.json +1 -1
  103. package/locales/sq/LC_MESSAGES/volto.po +25 -0
  104. package/locales/sq.json +1 -1
  105. package/locales/sr/LC_MESSAGES/volto.po +25 -0
  106. package/locales/sr.json +1 -1
  107. package/locales/sr@cyrl/LC_MESSAGES/volto.po +25 -0
  108. package/locales/sr@cyrl.json +1 -1
  109. package/locales/sr@latn/LC_MESSAGES/volto.po +25 -0
  110. package/locales/sr@latn.json +1 -1
  111. package/locales/sv/LC_MESSAGES/volto.po +25 -0
  112. package/locales/sv.json +1 -1
  113. package/locales/ta/LC_MESSAGES/volto.po +25 -0
  114. package/locales/ta.json +1 -1
  115. package/locales/te/LC_MESSAGES/volto.po +25 -0
  116. package/locales/te.json +1 -1
  117. package/locales/th/LC_MESSAGES/volto.po +25 -0
  118. package/locales/th.json +1 -1
  119. package/locales/to/LC_MESSAGES/volto.po +25 -0
  120. package/locales/to.json +1 -1
  121. package/locales/tr/LC_MESSAGES/volto.po +25 -0
  122. package/locales/tr.json +1 -1
  123. package/locales/uk/LC_MESSAGES/volto.po +25 -0
  124. package/locales/uk.json +1 -1
  125. package/locales/vi/LC_MESSAGES/volto.po +25 -0
  126. package/locales/vi.json +1 -1
  127. package/locales/volto.pot +26 -1
  128. package/locales/zh_CN/LC_MESSAGES/volto.po +25 -0
  129. package/locales/zh_CN.json +1 -1
  130. package/locales/zh_Hant/LC_MESSAGES/volto.po +25 -0
  131. package/locales/zh_Hant.json +1 -1
  132. package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +25 -0
  133. package/locales/zh_Hant_HK.json +1 -1
  134. package/package.json +7 -7
  135. package/razzle.config.js +1 -0
  136. package/src/actions/users/users.js +2 -2
  137. package/src/components/manage/Blocks/Block/Order/Item.jsx +18 -10
  138. package/src/components/manage/Blocks/Block/Order/Item.test.jsx +90 -0
  139. package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +7 -0
  140. package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
  141. package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
  142. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +3 -0
  143. package/src/components/manage/Widgets/DatetimeWidget.jsx +92 -58
  144. package/src/components/manage/Widgets/DatetimeWidget.test.jsx +55 -0
  145. package/src/components/manage/Widgets/FormFieldWrapper.jsx +7 -5
  146. package/src/components/manage/Widgets/TextWidget.jsx +4 -0
  147. package/src/components/manage/Widgets/UrlWidget.jsx +51 -6
  148. package/src/components/theme/Unauthorized/Unauthorized.jsx +30 -22
  149. package/src/components/theme/Unauthorized/Unauthorized.test.jsx +28 -1
  150. package/theme/themes/default/globals/site.variables +2 -2
  151. package/theme/themes/pastanaga/extras/main.less +15 -0
  152. package/theme/themes/pastanaga/globals/site.variables +0 -2
  153. package/types/components/manage/Blocks/Block/Order/Item.test.d.ts +1 -0
  154. package/webpack-plugins/webpack-less-plugin.js +1 -1
@@ -8,6 +8,7 @@ import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
8
8
  import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
9
9
 
10
10
  const Unauthorized = () => {
11
+ const token = useSelector((state) => state.userSession.token);
11
12
  const error_message = useSelector((state) => state.apierror?.message);
12
13
  let location = useLocation();
13
14
 
@@ -19,28 +20,35 @@ const Unauthorized = () => {
19
20
  </h1>
20
21
  <h3>{error_message}</h3>
21
22
  <p className="description">
22
- <FormattedMessage
23
- id="You are trying to access a protected resource, please {login} first."
24
- defaultMessage="You are trying to access a protected resource, please {login} first."
25
- values={{
26
- login: (
27
- <Link
28
- to={{
29
- pathname: `${getBaseUrl(location.pathname)}/login`,
30
- state: {
31
- // This is needed to cover the use case of being logged in in
32
- // another backend (eg. in development), having a token for
33
- // localhost and try to use it, the login route has to know that
34
- // it's the same as it comes from a logout
35
- isLogout: true,
36
- },
37
- }}
38
- >
39
- <FormattedMessage id="log in" defaultMessage="log in" />
40
- </Link>
41
- ),
42
- }}
43
- />
23
+ {token ? (
24
+ <FormattedMessage
25
+ id="You are trying to access a protected resource."
26
+ defaultMessage="You are trying to access a protected resource."
27
+ />
28
+ ) : (
29
+ <FormattedMessage
30
+ id="You are trying to access a protected resource, please {login} first."
31
+ defaultMessage="You are trying to access a protected resource, please {login} first."
32
+ values={{
33
+ login: (
34
+ <Link
35
+ to={{
36
+ pathname: `${getBaseUrl(location.pathname)}/login`,
37
+ state: {
38
+ // This is needed to cover the use case of being logged in in
39
+ // another backend (eg. in development), having a token for
40
+ // localhost and try to use it, the login route has to know that
41
+ // it's the same as it comes from a logout
42
+ isLogout: true,
43
+ },
44
+ }}
45
+ >
46
+ <FormattedMessage id="log in" defaultMessage="log in" />
47
+ </Link>
48
+ ),
49
+ }}
50
+ />
51
+ )}
44
52
  </p>
45
53
  <p>
46
54
  <FormattedMessage
@@ -9,8 +9,35 @@ import Unauthorized from './Unauthorized';
9
9
  const mockStore = configureStore();
10
10
 
11
11
  describe('Unauthorized', () => {
12
- it('renders a not found component', () => {
12
+ it('renders an unauthorized component', () => {
13
13
  const store = mockStore({
14
+ userSession: {
15
+ token: null,
16
+ },
17
+ intl: {
18
+ locale: 'en',
19
+ messages: {},
20
+ },
21
+ apierror: {
22
+ message: 'You are not authorized to access this resource',
23
+ },
24
+ });
25
+ const component = renderer.create(
26
+ <Provider store={store}>
27
+ <MemoryRouter>
28
+ <Unauthorized />
29
+ </MemoryRouter>
30
+ </Provider>,
31
+ );
32
+ const json = component.toJSON();
33
+ expect(json).toMatchSnapshot();
34
+ });
35
+
36
+ it('renders an unauthorized component for authenticated user', () => {
37
+ const store = mockStore({
38
+ userSession: {
39
+ token: '1234',
40
+ },
14
41
  intl: {
15
42
  locale: 'en',
16
43
  messages: {},
@@ -82,8 +82,8 @@
82
82
 
83
83
  /* Input Text Color */
84
84
  @inputColor: @textColor;
85
- @inputPlaceholderColor: lighten(@inputColor, 75);
86
- @inputPlaceholderFocusColor: lighten(@inputColor, 45);
85
+ @inputPlaceholderColor: lighten(@inputColor, 35);
86
+ @inputPlaceholderFocusColor: lighten(@inputColor, 65);
87
87
 
88
88
  /* Line Height Default For Inputs in Browser (Descenders are 17px at 14px base em) */
89
89
  @inputLineHeight: unit((17 / 14), em);
@@ -658,6 +658,21 @@ img.responsive {
658
658
  margin-top: 20px;
659
659
  }
660
660
 
661
+ // Accessibility
662
+ // This class is used to hide elements visually but keep them accessible for screen readers and assistive technologies.
663
+ // to not interfere with other 'visually-hidden' classes from other CSS frameworks (e.g. Semantic UI or TailwindCSS), we use a specific class name for Volto 18 (only).
664
+ .visually-hidden-volto {
665
+ position: absolute !important;
666
+ overflow: hidden !important;
667
+ width: 1px !important;
668
+ height: 1px !important;
669
+ padding: 0 !important;
670
+ border: 0 !important;
671
+ margin: -1px !important;
672
+ clip-path: inset(50%) !important;
673
+ white-space: nowrap !important;
674
+ }
675
+
661
676
  // Deprecated as per https://github.com/plone/volto/issues/1265
662
677
  // @import 'utils';
663
678
  @import (multiple) '../extras/fonts';
@@ -48,8 +48,6 @@
48
48
  /* This adjusts the default form input across all elements */
49
49
  @inputHorizontalPadding : 0;
50
50
 
51
- /* Input Text Color */
52
- @inputPlaceholderColor: #B8C6C8;
53
51
 
54
52
 
55
53
  /*-------------------
@@ -143,7 +143,7 @@ module.exports = (userOptions = {}) => ({
143
143
  /packages\/volto\/theme/,
144
144
  /plone\.volto\/theme/,
145
145
  /node_modules\/semantic-ui-less/,
146
- ...Object.values(registry.getResolveAliases()),
146
+ ...Object.values(registry.packages).map((p) => p.modulePath),
147
147
  ],
148
148
  use: isServer
149
149
  ? [