@plone/volto 18.0.0-alpha.46 → 18.0.0-alpha.48
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/.eslintrc +0 -1
- package/CHANGELOG.md +64 -0
- package/locales/ca/LC_MESSAGES/volto.po +82 -15
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +87 -20
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +82 -15
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +82 -15
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +82 -15
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +82 -15
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +82 -15
- package/locales/fr.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +82 -15
- package/locales/hi.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +82 -15
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +82 -15
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +82 -15
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +82 -15
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +82 -15
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +82 -15
- package/locales/ro.json +1 -1
- package/locales/volto.pot +83 -16
- package/locales/zh_CN/LC_MESSAGES/volto.po +82 -15
- package/locales/zh_CN.json +1 -1
- package/package.json +11 -9
- package/razzle.config.js +8 -5
- package/src/actions/aliases/aliases.js +27 -7
- package/src/actions/aliases/aliases.test.js +1 -1
- package/src/components/manage/Blocks/Block/Edit.jsx +1 -2
- package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +5 -2
- package/src/components/manage/Blocks/Block/StyleWrapper.jsx +1 -1
- package/src/components/manage/Blocks/Listing/getAsyncData.js +8 -0
- package/src/components/manage/Blocks/ToC/View.jsx +18 -7
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +2 -20
- package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +2 -19
- package/src/components/manage/Controlpanels/Aliases.jsx +499 -412
- package/src/components/manage/Controlpanels/Aliases.test.jsx +7 -0
- package/src/components/manage/Edit/Edit.jsx +7 -3
- package/src/components/manage/Form/ModalForm.jsx +3 -1
- package/src/components/manage/Toolbar/PersonalTools.jsx +7 -7
- package/src/components/manage/Toolbar/PersonalTools.test.jsx +71 -0
- package/src/components/manage/Widgets/IdWidget.jsx +6 -7
- package/src/components/theme/App/App.jsx +2 -0
- package/src/components/theme/App/App.test.jsx +4 -3
- package/src/components/theme/Login/Login.jsx +1 -2
- package/src/components/theme/RouteAnnouncer/RouteAnnouncer.jsx +64 -0
- package/src/constants/ActionTypes.js +1 -0
- package/src/express-middleware/static.js +2 -2
- package/src/helpers/Api/Api.js +12 -1
- package/src/helpers/Blocks/Blocks.js +73 -33
- package/src/helpers/Blocks/Blocks.test.js +204 -27
- package/src/middleware/api.js +3 -0
- package/src/reducers/content/content.js +12 -0
- package/src/start-server.js +2 -5
- package/types/actions/aliases/aliases.d.ts +8 -1
- package/types/components/manage/Blocks/ToC/View.d.ts +1 -4
- package/types/components/manage/Blocks/ToC/variations/DefaultTocRenderer.d.ts +10 -5
- package/types/components/manage/Blocks/ToC/variations/HorizontalMenu.d.ts +10 -5
- package/types/components/manage/Blocks/ToC/variations/index.d.ts +16 -4
- package/types/components/manage/Contents/__mocks__/index.d.ts +0 -1
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/index.d.ts +0 -1
- package/types/components/manage/Form/__mocks__/index.d.ts +0 -1
- package/types/components/manage/Form/index.d.ts +0 -1
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +1 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/UrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/__mocks__/index.d.ts +0 -1
- package/types/components/manage/Widgets/index.d.ts +2 -3
- package/types/components/theme/RouteAnnouncer/RouteAnnouncer.d.ts +2 -0
- package/types/config/slots.d.ts +1 -1
- package/types/constants/ActionTypes.d.ts +1 -0
- package/types/helpers/Blocks/Blocks.d.ts +10 -1
- package/types/helpers/Helmet/Helmet.d.ts +1 -1
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
* @module components/manage/Blocks/ToC/View
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React from 'react';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { map } from 'lodash';
|
|
9
8
|
import { List } from 'semantic-ui-react';
|
|
10
|
-
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
11
9
|
import Slugger from 'github-slugger';
|
|
12
10
|
import { UniversalLink } from '@plone/volto/components';
|
|
13
11
|
import { normalizeString } from '@plone/volto/helpers';
|
|
@@ -37,26 +35,10 @@ const RenderListItems = ({ items, data }) => {
|
|
|
37
35
|
});
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
/**
|
|
41
|
-
* View toc block class.
|
|
42
|
-
* @class View
|
|
43
|
-
* @extends Component
|
|
44
|
-
*/
|
|
45
38
|
const View = ({ data, tocEntries }) => {
|
|
46
39
|
return (
|
|
47
40
|
<>
|
|
48
|
-
{data.title && !data.hide_title ?
|
|
49
|
-
<h2>
|
|
50
|
-
{data.title || (
|
|
51
|
-
<FormattedMessage
|
|
52
|
-
id="Table of Contents"
|
|
53
|
-
defaultMessage="Table of Contents"
|
|
54
|
-
/>
|
|
55
|
-
)}
|
|
56
|
-
</h2>
|
|
57
|
-
) : (
|
|
58
|
-
''
|
|
59
|
-
)}
|
|
41
|
+
{data.title && !data.hide_title ? <h2>{data.title}</h2> : ''}
|
|
60
42
|
<List
|
|
61
43
|
ordered={data.ordered}
|
|
62
44
|
bulleted={!data.ordered}
|
|
@@ -77,4 +59,4 @@ View.propTypes = {
|
|
|
77
59
|
properties: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
78
60
|
};
|
|
79
61
|
|
|
80
|
-
export default
|
|
62
|
+
export default View;
|
|
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { map } from 'lodash';
|
|
4
4
|
import { Menu, Dropdown } from 'semantic-ui-react';
|
|
5
|
-
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
6
5
|
import AnchorLink from 'react-anchor-link-smooth-scroll';
|
|
7
6
|
import Slugger from 'github-slugger';
|
|
8
7
|
import { normalizeString } from '@plone/volto/helpers';
|
|
@@ -26,11 +25,6 @@ const RenderMenuItems = ({ items }) => {
|
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
/**
|
|
30
|
-
* View toc block class.
|
|
31
|
-
* @class View
|
|
32
|
-
* @extends Component
|
|
33
|
-
*/
|
|
34
28
|
const View = ({ data, tocEntries }) => {
|
|
35
29
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
36
30
|
// When the page is resized to prevent items from the TOC from going out of the viewport,
|
|
@@ -159,18 +153,7 @@ const View = ({ data, tocEntries }) => {
|
|
|
159
153
|
|
|
160
154
|
return (
|
|
161
155
|
<>
|
|
162
|
-
{data.title && !data.hide_title ?
|
|
163
|
-
<h2>
|
|
164
|
-
{data.title || (
|
|
165
|
-
<FormattedMessage
|
|
166
|
-
id="Table of Contents"
|
|
167
|
-
defaultMessage="Table of Contents"
|
|
168
|
-
/>
|
|
169
|
-
)}
|
|
170
|
-
</h2>
|
|
171
|
-
) : (
|
|
172
|
-
''
|
|
173
|
-
)}
|
|
156
|
+
{data.title && !data.hide_title ? <h2>{data.title}</h2> : ''}
|
|
174
157
|
<Menu className="responsive-menu">
|
|
175
158
|
<RenderMenuItems items={tocEntries} />
|
|
176
159
|
<Dropdown
|
|
@@ -201,4 +184,4 @@ View.propTypes = {
|
|
|
201
184
|
properties: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
202
185
|
};
|
|
203
186
|
|
|
204
|
-
export default
|
|
187
|
+
export default View;
|