@plone/volto 17.0.0-alpha.13 → 17.0.0-alpha.15
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/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +68 -0
- package/README.md +2 -2
- package/docker-compose.yml +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +5 -0
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +5 -0
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +5 -0
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +49 -44
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +5 -0
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +5 -0
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +5 -0
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +5 -0
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +5 -0
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +5 -0
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +5 -0
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +5 -0
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +5 -0
- package/locales/ro.json +1 -1
- package/locales/volto.pot +5 -0
- package/locales/zh_CN/LC_MESSAGES/volto.po +5 -0
- package/locales/zh_CN.json +1 -1
- package/package.json +2 -1
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/actions/index.js +1 -1
- package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +20 -16
- package/packages/volto-slate/src/blocks/Text/index.js +2 -2
- package/packages/volto-slate/src/editor/config.jsx +5 -4
- package/packages/volto-slate/src/editor/index.js +4 -4
- package/packages/volto-slate/src/editor/less/slate.less +28 -0
- package/packages/volto-slate/src/editor/render.jsx +68 -8
- package/packages/volto-slate/src/editor/ui/SlateContextToolbar.jsx +2 -2
- package/packages/volto-slate/src/editor/ui/index.js +15 -15
- package/packages/volto-slate/src/index.js +2 -2
- package/src/components/manage/AnchorPlugin/index.jsx +2 -2
- package/src/components/manage/AnchorPlugin/utils/EditorUtils.js +3 -1
- package/src/components/manage/Blocks/Block/Style.jsx +2 -2
- package/src/components/manage/Blocks/Listing/DefaultTemplate.jsx +18 -3
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +30 -8
- package/src/components/manage/Blocks/Listing/getAsyncData.js +3 -5
- package/src/components/manage/Blocks/Search/components/index.js +13 -13
- package/src/components/manage/Blocks/Search/hocs/index.js +2 -2
- package/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +2 -2
- package/src/components/manage/Blocks/Title/View.jsx +15 -5
- package/src/components/manage/Blocks/Title/View.test.jsx +16 -1
- package/src/components/manage/Blocks/ToC/View.jsx +8 -1
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +17 -4
- package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +6 -2
- package/src/components/manage/Blocks/ToC/variations/index.js +3 -1
- package/src/components/theme/Anontools/Anontools.jsx +45 -72
- package/src/components/theme/Anontools/Anontools.stories.jsx +16 -6
- package/src/components/theme/Anontools/Anontools.test.jsx +16 -2
- package/src/config/RichTextEditor/Blocks.jsx +2 -2
- package/src/config/RichTextEditor/FromHTML.jsx +2 -2
- package/src/config/RichTextEditor/Styles.jsx +1 -1
- package/src/constants/Indexes.js +3 -1
- package/src/express-middleware/devproxy.js +1 -1
- package/src/express-middleware/files.js +3 -3
- package/src/express-middleware/images.js +4 -4
- package/src/express-middleware/robotstxt.js +1 -1
- package/src/express-middleware/sitemap.js +1 -1
- package/src/express-middleware/static.js +3 -3
- package/src/helpers/Extensions/index.js +2 -1
- package/src/helpers/MessageLabels/MessageLabels.js +4 -0
- package/src/helpers/ScrollToTop/ScrollToTop.jsx +5 -3
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +191 -0
- package/src/helpers/index.js +9 -10
- package/src/hooks/clipboard/useClipboard.js +26 -0
- package/src/hooks/content/useContent.js +31 -0
- package/src/hooks/index.js +2 -0
- package/src/middleware/index.js +2 -2
- package/src/start-server.js +2 -2
- package/theme/themes/pastanaga/extras/blocks.less +3 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
export default function useClipboard(clipboardText = '') {
|
|
4
|
+
const stringToCopy = useRef(clipboardText);
|
|
5
|
+
const [copied, setCopied] = useState(false);
|
|
6
|
+
|
|
7
|
+
//synchronous: window.clipboardData.setData(options.format || "text", text);
|
|
8
|
+
const copyToClipboard = async (text) => {
|
|
9
|
+
if ('clipboard' in navigator) {
|
|
10
|
+
return await navigator.clipboard.writeText(text);
|
|
11
|
+
} else {
|
|
12
|
+
return document.execCommand('copy', true, text);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const copyAction = useCallback(() => {
|
|
17
|
+
const copiedString = copyToClipboard(stringToCopy.current);
|
|
18
|
+
setCopied(copiedString);
|
|
19
|
+
}, [stringToCopy]);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
stringToCopy.current = clipboardText;
|
|
23
|
+
}, [clipboardText]);
|
|
24
|
+
|
|
25
|
+
return [copied, copyAction, setCopied];
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useSelector, shallowEqual } from 'react-redux';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useContent hook
|
|
5
|
+
*
|
|
6
|
+
* This hook returns the current content that is stored in the Redux store in the
|
|
7
|
+
* `content` reducer, and returns it along with the related state (loading/loaded/error).
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @return {{ data: ContentData, loading: boolean, loaded: boolean, error: Error }}
|
|
11
|
+
*/
|
|
12
|
+
export function useContent() {
|
|
13
|
+
const data = useSelector((state) => state.content.data, shallowEqual);
|
|
14
|
+
const loading = useSelector((state) => state.content.get.loading);
|
|
15
|
+
const loaded = useSelector((state) => state.content.get.loaded);
|
|
16
|
+
const error = useSelector((state) => state.content.get.error, shallowEqual);
|
|
17
|
+
|
|
18
|
+
return { data, loading, loaded, error };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// For reference purposes: Potential future useQuery version
|
|
22
|
+
// export function useContent() {
|
|
23
|
+
// // the cache will need to know the current location
|
|
24
|
+
// const pathname = useLocation();
|
|
25
|
+
// const query = useQuery(getContentQuery({ path }))
|
|
26
|
+
|
|
27
|
+
// // This might not be needed if we rename the properties
|
|
28
|
+
// const {isLoading: loading, isSuccess: loaded, ...rest} = query;
|
|
29
|
+
|
|
30
|
+
// return { loading, loaded, ...rest };
|
|
31
|
+
// }
|
package/src/middleware/index.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @example import { api } from 'middleware';
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export api from '@plone/volto/middleware/api';
|
|
8
|
-
export blacklistRoutes from './blacklistRoutes';
|
|
7
|
+
export { default as api } from '@plone/volto/middleware/api';
|
|
8
|
+
export { default as blacklistRoutes } from './blacklistRoutes';
|
|
9
9
|
export {
|
|
10
10
|
protectLoadStart,
|
|
11
11
|
protectLoadEnd,
|
package/src/start-server.js
CHANGED
|
@@ -4,7 +4,7 @@ import http from 'http';
|
|
|
4
4
|
import app from './server';
|
|
5
5
|
import debug from 'debug';
|
|
6
6
|
|
|
7
|
-
export default ()
|
|
7
|
+
export default function server() {
|
|
8
8
|
const server = http.createServer(app);
|
|
9
9
|
// const host = process.env.HOST || 'localhost';
|
|
10
10
|
const port = process.env.PORT || 3000;
|
|
@@ -46,4 +46,4 @@ export default () => {
|
|
|
46
46
|
currentApp = newApp;
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -477,7 +477,9 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
|
|
|
477
477
|
|
|
478
478
|
&.new-add-block {
|
|
479
479
|
bottom: -26px;
|
|
480
|
-
left:
|
|
480
|
+
left: calc(
|
|
481
|
+
50% - 12px
|
|
482
|
+
); // This is to compensate the width of the icon and center it correctly
|
|
481
483
|
padding: 0 !important;
|
|
482
484
|
border: none !important;
|
|
483
485
|
background: white !important;
|