@plone/volto 17.0.0-alpha.26 → 17.0.0-alpha.28
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 +26 -3
- package/.yarn/install-state.gz +0 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
- package/.yarn/releases/yarn-3.6.3.cjs +874 -0
- package/CHANGELOG.md +60 -0
- package/addon-registry.js +10 -1
- package/create-addons-loader.js +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +57 -31
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +58 -32
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +57 -31
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +65 -39
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +57 -31
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +57 -31
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +57 -31
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +57 -31
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +57 -31
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +57 -31
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +57 -31
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +57 -31
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +57 -31
- package/locales/ro.json +1 -1
- package/locales/volto.pot +62 -32
- package/locales/zh_CN/LC_MESSAGES/volto.po +57 -31
- package/locales/zh_CN.json +1 -1
- package/package.json +35 -26
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +2 -1
- package/packages/volto-slate/src/blocks/Text/index.js +0 -5
- package/packages/volto-slate/src/editor/plugins/Link/render.jsx +5 -6
- package/packages/volto-slate/src/editor/render.jsx +11 -1
- package/razzle.config.js +4 -6
- package/src/components/index.js +194 -194
- package/src/components/manage/Add/Add.jsx +7 -8
- package/src/components/manage/Blocks/Block/Settings.test.jsx +17 -15
- package/src/components/manage/Blocks/HTML/Edit.jsx +8 -8
- package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +30 -25
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +6 -4
- package/src/components/manage/Blocks/Maps/Edit.test.jsx +1 -2
- package/src/components/manage/Blocks/Maps/View.test.jsx +1 -2
- package/src/components/manage/Blocks/Search/components/Facets.jsx +2 -3
- package/src/components/manage/Blocks/Search/components/FilterList.jsx +4 -6
- package/src/components/manage/Blocks/Search/components/SelectFacet.jsx +2 -9
- package/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +3 -0
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +8 -6
- package/src/components/manage/Blocks/Search/schema.js +13 -13
- package/src/components/manage/Blocks/Table/Cell.jsx +2 -3
- package/src/components/manage/Blocks/Text/Edit.jsx +2 -3
- package/src/components/manage/Blocks/Title/View.jsx +4 -37
- package/src/components/manage/Blocks/ToC/View.jsx +1 -0
- package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +3 -2
- package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +3 -2
- package/src/components/manage/Contents/Contents.jsx +252 -114
- package/src/components/manage/Contents/ContentsPropertiesModal.jsx +90 -154
- package/src/components/manage/Contents/ContentsRenameModal.jsx +88 -139
- package/src/components/manage/Contents/ContentsRenameModal.stories.jsx +61 -0
- package/src/components/manage/Contents/ContentsTagsModal.jsx +83 -130
- package/src/components/manage/Contents/ContentsTagsModal.stories.jsx +68 -0
- package/src/components/manage/Contents/ContentsUploadModal.jsx +1 -2
- package/src/components/manage/Contents/ContentsWorkflowModal.jsx +87 -154
- package/src/components/manage/Controlpanels/Aliases.jsx +4 -12
- package/src/components/manage/Controlpanels/Rules/AddRule.jsx +2 -9
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +6 -9
- package/src/components/manage/Form/BlockDataForm.test.jsx +17 -15
- package/src/components/manage/Form/Form.jsx +2 -3
- package/src/components/manage/Form/InlineForm.test.jsx +16 -14
- package/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx +1 -2
- package/src/components/manage/Sharing/Sharing.jsx +7 -0
- package/src/components/manage/Sidebar/Sidebar.jsx +139 -220
- package/src/components/manage/Toolbar/More.jsx +12 -12
- package/src/components/manage/Toolbar/PersonalTools.jsx +97 -155
- package/src/components/manage/Toolbar/Toolbar.jsx +2 -2
- package/src/components/manage/UniversalLink/UniversalLink.test.jsx +2 -1
- package/src/components/manage/Widgets/AlignWidget.jsx +2 -4
- package/src/components/manage/Widgets/ColorPickerWidget.test.jsx +9 -7
- package/src/components/manage/Widgets/DatetimeWidget.jsx +2 -8
- package/src/components/manage/Widgets/IdWidget.jsx +1 -2
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +2 -9
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +2 -9
- package/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +4 -4
- package/src/components/manage/Widgets/SchemaWidget.jsx +6 -9
- package/src/components/manage/Widgets/WysiwygWidget.jsx +2 -9
- package/src/components/theme/Comments/Comments.jsx +3 -10
- package/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +4 -0
- package/src/components/theme/Login/Login.jsx +1 -2
- package/src/components/theme/PasswordReset/PasswordReset.jsx +1 -2
- package/src/components/theme/PreviewImage/PreviewImage.jsx +10 -5
- package/src/components/theme/PreviewImage/PreviewImage.test.js +17 -0
- package/src/components/theme/Register/Register.jsx +2 -4
- package/src/components/theme/TsTest/TsTest.test.tsx +11 -0
- package/src/components/theme/TsTest/TsTest.tsx +15 -0
- package/src/components/theme/View/AlbumView.jsx +3 -2
- package/src/components/theme/Widgets/ImageWidget.stories.jsx +1 -2
- package/src/config/Loadables.jsx +1 -1
- package/src/config/RichTextEditor/Blocks.jsx +2 -3
- package/src/config/RichTextEditor/Plugins.jsx +2 -3
- package/src/config/RichTextEditor/ToHTML.jsx +12 -10
- package/src/config/RichTextEditor/index.js +2 -3
- package/src/config/Views.jsx +5 -5
- package/src/express-middleware/ok.js +1 -1
- package/src/helpers/Blocks/Blocks.js +4 -6
- package/src/helpers/Blocks/Blocks.test.js +35 -35
- package/src/helpers/Extensions/withBlockSchemaEnhancer.js +48 -50
- package/src/helpers/FormValidation/FormValidation.js +7 -6
- package/src/helpers/Html/Html.jsx +2 -8
- package/src/helpers/Loadable/__mocks__/Loadable.js +18 -18
- package/src/helpers/MessageLabels/MessageLabels.js +2 -3
- package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +2 -3
- package/src/helpers/Utils/Utils.js +10 -0
- package/src/helpers/Utils/Utils.test.js +13 -0
- package/src/helpers/index.js +1 -0
- package/src/hooks/index.js +1 -1
- package/src/middleware/api.js +194 -190
- package/src/middleware/blacklistRoutes.js +25 -22
- package/src/middleware/storeProtectLoadUtils.js +61 -62
- package/src/middleware/storeProtectLoadUtils.test.js +47 -43
- package/src/reducers/content/content.test.js +4 -4
- package/src/reducers/navigation/navigation.js +5 -5
- package/src/reducers/navigation/navigation.test.js +30 -0
- package/src/registry.js +2 -2
- package/src/storybook.jsx +24 -38
- package/theme/themes/pastanaga/collections/menu.overrides +3 -2
- package/theme/themes/pastanaga/elements/container.overrides +5 -2
- package/theme/themes/pastanaga/elements/input.overrides +1 -1
- package/theme/themes/pastanaga/elements/step.overrides +2 -1
- package/theme/themes/pastanaga/extras/blocks.less +20 -14
- package/theme/themes/pastanaga/extras/color-picker-widget.less +1 -1
- package/theme/themes/pastanaga/extras/contents.less +5 -1
- package/theme/themes/pastanaga/extras/draftjs.less +4 -4
- package/theme/themes/pastanaga/extras/grid.less +5 -4
- package/theme/themes/pastanaga/extras/main.less +6 -6
- package/theme/themes/pastanaga/extras/react-dates-overrides.less +4 -2
- package/theme/themes/pastanaga/extras/search.less +2 -2
- package/theme/themes/pastanaga/extras/sidebar.less +5 -4
- package/theme/themes/pastanaga/extras/time-picker-overrides.less +5 -3
- package/theme/themes/pastanaga/extras/toolbar.less +6 -2
- package/theme/themes/pastanaga/extras/userscontrolpanel.less +17 -9
- package/theme/themes/pastanaga/extras/widgets.less +1 -1
- package/theme/themes/pastanaga/modules/rating.overrides +2 -1
- package/theme/themes/pastanaga-cms-ui/elements/container.overrides +2 -1
- package/theme/themes/pastanaga-cms-ui/extras/cms-ui.elements.container.less +6 -2
- package/theme/themes/pastanaga-cms-ui/extras/cms-ui.site.less +2 -2
- package/tsconfig.json +33 -0
|
@@ -63,8 +63,9 @@ class AlbumView extends React.Component {
|
|
|
63
63
|
const { content } = this.props;
|
|
64
64
|
const Container =
|
|
65
65
|
config.getComponent({ name: 'Container' }).component || SemanticContainer;
|
|
66
|
-
const PreviewImage = config.getComponent({
|
|
67
|
-
|
|
66
|
+
const PreviewImage = config.getComponent({
|
|
67
|
+
name: 'PreviewImage',
|
|
68
|
+
}).component;
|
|
68
69
|
|
|
69
70
|
return (
|
|
70
71
|
<Container className="view-wrapper">
|
|
@@ -17,8 +17,7 @@ Image.args = {
|
|
|
17
17
|
value: {
|
|
18
18
|
download: 'download/filename.png',
|
|
19
19
|
file_name: 'filename.png',
|
|
20
|
-
data:
|
|
21
|
-
'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAKlUlEQVR4nOSbf2xT19nHvzVJXvu1oUnbNHanZEnjFOK1jYM0VCeetqa0CenvOpSCRoGw0S2UTQFGqqmptAVVS1uI1JV0BRoIaOnKkkCpIAnQhE1xUmAitujiQI1sFYqdQZe0s2tTAkzn+AJOcs+959oGuu0j+R/f85z7PM+995znOec5SbjeZBdMR47ZAkNuAVL1M2AwZgPIAJA2oeUIgGH43F6M+ofgO+mEx9EPr/P49VTvloT3qNZOQb51NvKLbci3Pgrgrjh7PANX7x647G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uWMIuk0rOKoM+dSstSxEplRodHoNaeRqbpSY7p8Cy21TyKc6e+kGknDnnyc2vXwWRdKdHqPHbUlcN/ctJUL14ldu7UMNTaUWSaypldEifkzcrDse69tFprIjRZuTyIHPNsZjQWCgxgW80crsILMSJlcttxt/mnku36WqvxcfuHYpcSVSg5j1ZmiJGacSsstkqh8Pm79Gl4HINw2Vsx0Lkr5r0HMtqTAe+6FUriv6JUdj+aqh+LvVQW/9HF0nasn/9wfMXS126uQWXDB9whbuLL5eejsOxFBeXy5Mk/mZhy+SvEfmBiH92idtkPxnBgokzI52/ygYlo5lS9iKKKN+I4MnNCODJzNmrdTwfgDuiNWdDo2Gt40pxHX+sqdDRuUCIU66GpAuHQlHhZ6o2GBDnt9QtjOTQlHgfIQeKEI7s309pbg/EBuqhxcwjgaOcr2F6zRCzI4SGRBycrFX2r8fEtODg5kf/Zo7MTGX94upxWY8XH53D17v32H55mETk+/wAMuWaFx+cH4HEcut7H5/8dAAD//1geHQaS0wzXAAAAAElFTkSuQmCC',
|
|
22
21
|
size: 100,
|
|
23
22
|
'content-type': 'image/png',
|
|
24
23
|
},
|
package/src/config/Loadables.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import loadable from '@loadable/component';
|
|
|
2
2
|
|
|
3
3
|
export const loadables = {
|
|
4
4
|
prettierStandalone: loadable.lib(() => import('prettier/standalone')),
|
|
5
|
-
prettierParserHtml: loadable.lib(() => import('prettier/
|
|
5
|
+
prettierParserHtml: loadable.lib(() => import('prettier/plugins/html')),
|
|
6
6
|
prismCore: loadable.lib(() => import('prismjs/components/prism-core')),
|
|
7
7
|
toastify: loadable.lib(() => import('react-toastify')),
|
|
8
8
|
reactSelect: loadable.lib(() => import('react-select'), { ssr: false }),
|
|
@@ -12,9 +12,8 @@ export default function Blocks(props) {
|
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
const extendedBlockRenderMap =
|
|
16
|
-
blockRenderMap
|
|
17
|
-
);
|
|
15
|
+
const extendedBlockRenderMap =
|
|
16
|
+
DefaultDraftBlockRenderMap.merge(blockRenderMap);
|
|
18
17
|
|
|
19
18
|
const blockStyleFn = (contentBlock) => {
|
|
20
19
|
const type = contentBlock.getType();
|
|
@@ -23,9 +23,8 @@ const breakOutOptions = {
|
|
|
23
23
|
const plugins = (props) => {
|
|
24
24
|
const { draftJsInlineToolbarPlugin, draftJsBlockBreakoutPlugin } = props;
|
|
25
25
|
const { Separator } = draftJsInlineToolbarPlugin;
|
|
26
|
-
const blockBreakoutPlugin =
|
|
27
|
-
breakOutOptions
|
|
28
|
-
);
|
|
26
|
+
const blockBreakoutPlugin =
|
|
27
|
+
draftJsBlockBreakoutPlugin.default(breakOutOptions);
|
|
29
28
|
|
|
30
29
|
const linkPlugin = createLinkPlugin({ libraries: props });
|
|
31
30
|
|
|
@@ -101,16 +101,18 @@ const splitSoftLinesOfLists = (children) =>
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
// Returns how the default lists should be rendered
|
|
104
|
-
const getList =
|
|
105
|
-
ordered
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
const getList =
|
|
105
|
+
(ordered) =>
|
|
106
|
+
(children, { depth, keys }) =>
|
|
107
|
+
ordered ? (
|
|
108
|
+
<ol key={keys[0]} keys={keys} depth={depth}>
|
|
109
|
+
{splitSoftLinesOfLists(children)}
|
|
110
|
+
</ol>
|
|
111
|
+
) : (
|
|
112
|
+
<ul key={keys[0]} keys={keys} depth={depth}>
|
|
113
|
+
{splitSoftLinesOfLists(children)}
|
|
114
|
+
</ul>
|
|
115
|
+
);
|
|
114
116
|
|
|
115
117
|
// Special function to deal with list clones
|
|
116
118
|
/*const getSpecialList = type => (children, { depth, keys }) => (
|
|
@@ -5,9 +5,8 @@ import FromHTMLCustomBlockFn from './FromHTML';
|
|
|
5
5
|
|
|
6
6
|
export const richtextEditorSettings = (props) => {
|
|
7
7
|
const { plugins, inlineToolbarButtons } = Plugins(props);
|
|
8
|
-
const { extendedBlockRenderMap, blockStyleFn, listBlockTypes } =
|
|
9
|
-
props
|
|
10
|
-
);
|
|
8
|
+
const { extendedBlockRenderMap, blockStyleFn, listBlockTypes } =
|
|
9
|
+
Blocks(props);
|
|
11
10
|
|
|
12
11
|
return {
|
|
13
12
|
extendedBlockRenderMap,
|
package/src/config/Views.jsx
CHANGED
|
@@ -111,11 +111,11 @@ export const contentTypesViews = {
|
|
|
111
111
|
export const defaultView = DefaultView;
|
|
112
112
|
|
|
113
113
|
export const errorViews = {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
404: NotFoundView,
|
|
115
|
+
401: Unauthorized,
|
|
116
|
+
403: Forbidden,
|
|
117
|
+
408: RequestTimeout,
|
|
118
|
+
500: ServerError,
|
|
119
119
|
ECONNREFUSED: ConnectionRefused,
|
|
120
120
|
corsError: CorsError,
|
|
121
121
|
};
|
|
@@ -8,7 +8,7 @@ const ok = function (req, res, next) {
|
|
|
8
8
|
res.send('ok');
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export default function () {
|
|
11
|
+
export default function okRouteMiddleware() {
|
|
12
12
|
const middleware = express.Router();
|
|
13
13
|
middleware.all(config?.settings?.okRoute || '/ok', ok);
|
|
14
14
|
middleware.id = 'ok';
|
|
@@ -290,9 +290,8 @@ export function changeBlock(formData, id, value) {
|
|
|
290
290
|
*/
|
|
291
291
|
export function nextBlockId(formData, currentBlock) {
|
|
292
292
|
const blocksLayoutFieldname = getBlocksLayoutFieldname(formData);
|
|
293
|
-
const currentIndex =
|
|
294
|
-
currentBlock
|
|
295
|
-
);
|
|
293
|
+
const currentIndex =
|
|
294
|
+
formData[blocksLayoutFieldname].items.indexOf(currentBlock);
|
|
296
295
|
|
|
297
296
|
if (currentIndex === formData[blocksLayoutFieldname].items.length - 1) {
|
|
298
297
|
// We are already at the bottom block don't do anything
|
|
@@ -312,9 +311,8 @@ export function nextBlockId(formData, currentBlock) {
|
|
|
312
311
|
*/
|
|
313
312
|
export function previousBlockId(formData, currentBlock) {
|
|
314
313
|
const blocksLayoutFieldname = getBlocksLayoutFieldname(formData);
|
|
315
|
-
const currentIndex =
|
|
316
|
-
currentBlock
|
|
317
|
-
);
|
|
314
|
+
const currentIndex =
|
|
315
|
+
formData[blocksLayoutFieldname].items.indexOf(currentBlock);
|
|
318
316
|
|
|
319
317
|
if (currentIndex === 0) {
|
|
320
318
|
// We are already at the top block don't do anything
|
|
@@ -588,26 +588,26 @@ describe('Blocks', () => {
|
|
|
588
588
|
const d = {
|
|
589
589
|
data: {
|
|
590
590
|
blocks: {
|
|
591
|
-
|
|
591
|
+
1: {
|
|
592
592
|
blocks: {
|
|
593
|
-
|
|
594
|
-
|
|
593
|
+
2: {},
|
|
594
|
+
3: {
|
|
595
595
|
data: {
|
|
596
596
|
blocks: {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
597
|
+
11: {},
|
|
598
|
+
12: {},
|
|
599
|
+
13: {},
|
|
600
600
|
},
|
|
601
601
|
blocks_layout: {
|
|
602
602
|
items: ['11', '12', '13'],
|
|
603
603
|
},
|
|
604
604
|
},
|
|
605
605
|
},
|
|
606
|
-
|
|
606
|
+
7: {
|
|
607
607
|
blocks: {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
608
|
+
8: {},
|
|
609
|
+
9: {},
|
|
610
|
+
10: {},
|
|
611
611
|
},
|
|
612
612
|
blocks_layout: {
|
|
613
613
|
items: ['8', '9', '10'],
|
|
@@ -618,10 +618,10 @@ describe('Blocks', () => {
|
|
|
618
618
|
items: ['2', '3', '7'],
|
|
619
619
|
},
|
|
620
620
|
},
|
|
621
|
-
|
|
621
|
+
4: {
|
|
622
622
|
blocks: {
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
5: {},
|
|
624
|
+
6: {},
|
|
625
625
|
},
|
|
626
626
|
blocks_layout: {
|
|
627
627
|
items: ['5', '6'],
|
|
@@ -1302,10 +1302,10 @@ describe('Blocks', () => {
|
|
|
1302
1302
|
describe('findBlocks', () => {
|
|
1303
1303
|
it('Get all blocks in the first level (main block container)', () => {
|
|
1304
1304
|
const blocks = {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1305
|
+
1: { title: 'title', '@type': 'title' },
|
|
1306
|
+
2: { title: 'an image', '@type': 'image' },
|
|
1307
|
+
3: { title: 'description', '@type': 'description' },
|
|
1308
|
+
4: { title: 'a text', '@type': 'slate' },
|
|
1309
1309
|
};
|
|
1310
1310
|
const types = ['description'];
|
|
1311
1311
|
expect(findBlocks(blocks, types)).toStrictEqual(['3']);
|
|
@@ -1313,10 +1313,10 @@ describe('findBlocks', () => {
|
|
|
1313
1313
|
|
|
1314
1314
|
it('Get all blocks in the first level (main block container) given a list', () => {
|
|
1315
1315
|
const blocks = {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1316
|
+
1: { title: 'title', '@type': 'title' },
|
|
1317
|
+
2: { title: 'an image', '@type': 'image' },
|
|
1318
|
+
3: { title: 'description', '@type': 'description' },
|
|
1319
|
+
4: { title: 'a text', '@type': 'slate' },
|
|
1320
1320
|
};
|
|
1321
1321
|
const types = ['description', 'slate'];
|
|
1322
1322
|
expect(findBlocks(blocks, types)).toStrictEqual(['3', '4']);
|
|
@@ -1324,11 +1324,11 @@ describe('findBlocks', () => {
|
|
|
1324
1324
|
|
|
1325
1325
|
it('Get all blocks in the first level (main block container) given a list', () => {
|
|
1326
1326
|
const blocks = {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1327
|
+
1: { title: 'title', '@type': 'title' },
|
|
1328
|
+
2: { title: 'an image', '@type': 'image' },
|
|
1329
|
+
3: { title: 'description', '@type': 'description' },
|
|
1330
|
+
4: { title: 'a text', '@type': 'slate' },
|
|
1331
|
+
5: { title: 'a text', '@type': 'slate' },
|
|
1332
1332
|
};
|
|
1333
1333
|
const types = ['description', 'slate'];
|
|
1334
1334
|
expect(findBlocks(blocks, types)).toStrictEqual(['3', '4', '5']);
|
|
@@ -1336,18 +1336,18 @@ describe('findBlocks', () => {
|
|
|
1336
1336
|
|
|
1337
1337
|
it('Get all blocks, including containers, given a list', () => {
|
|
1338
1338
|
const blocks = {
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1339
|
+
1: { title: 'title', '@type': 'title' },
|
|
1340
|
+
2: { title: 'an image', '@type': 'image' },
|
|
1341
|
+
3: { title: 'description', '@type': 'description' },
|
|
1342
|
+
4: { title: 'a text', '@type': 'slate' },
|
|
1343
|
+
5: {
|
|
1344
1344
|
title: 'a container',
|
|
1345
1345
|
'@type': 'gridBlock',
|
|
1346
1346
|
blocks: {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1347
|
+
6: { title: 'title', '@type': 'title' },
|
|
1348
|
+
7: { title: 'an image', '@type': 'image' },
|
|
1349
|
+
8: { title: 'description', '@type': 'description' },
|
|
1350
|
+
9: { title: 'a text', '@type': 'slate' },
|
|
1351
1351
|
},
|
|
1352
1352
|
},
|
|
1353
1353
|
};
|
|
@@ -110,61 +110,59 @@ export const addExtensionFieldToSchema = ({
|
|
|
110
110
|
* }
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
export const withBlockSchemaEnhancer =
|
|
114
|
-
FormComponent,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const { formData, schema: originalSchema } = props;
|
|
119
|
-
const intl = useIntl();
|
|
113
|
+
export const withBlockSchemaEnhancer =
|
|
114
|
+
(FormComponent, extensionName = 'vendor', insertFieldToOrder = _addField) =>
|
|
115
|
+
({ ...props }) => {
|
|
116
|
+
const { formData, schema: originalSchema } = props;
|
|
117
|
+
const intl = useIntl();
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
const blocksConfig = getBlocksConfig(props);
|
|
122
120
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (!extensionConfig)
|
|
128
|
-
return <FormComponent {...props} schema={originalSchema} />;
|
|
129
|
-
|
|
130
|
-
const activeItemName = formData?.[extensionName];
|
|
131
|
-
let activeItem = extensionConfig.items?.find(
|
|
132
|
-
(item) => item.id === activeItemName,
|
|
133
|
-
);
|
|
134
|
-
if (!activeItem)
|
|
135
|
-
activeItem = extensionConfig.items?.find((item) => item.isDefault);
|
|
136
|
-
|
|
137
|
-
const schemaEnhancer =
|
|
138
|
-
// For the main "variation" of blocks, allow simply passing a
|
|
139
|
-
// schemaEnhancer in the block configuration
|
|
140
|
-
activeItem?.['schemaEnhancer'] ||
|
|
141
|
-
(extensionName === 'variation' &&
|
|
142
|
-
blocksConfig?.[blockType]?.schemaEnhancer);
|
|
143
|
-
|
|
144
|
-
let schema = schemaEnhancer
|
|
145
|
-
? schemaEnhancer({
|
|
146
|
-
schema: cloneDeepSchema(originalSchema),
|
|
147
|
-
formData,
|
|
148
|
-
intl,
|
|
149
|
-
})
|
|
150
|
-
: cloneDeepSchema(originalSchema);
|
|
121
|
+
const blockType = formData['@type'];
|
|
122
|
+
const extensionConfig =
|
|
123
|
+
blocksConfig?.[blockType]?.extensions?.[extensionName];
|
|
151
124
|
|
|
152
|
-
|
|
125
|
+
if (!extensionConfig)
|
|
126
|
+
return <FormComponent {...props} schema={originalSchema} />;
|
|
153
127
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
128
|
+
const activeItemName = formData?.[extensionName];
|
|
129
|
+
let activeItem = extensionConfig.items?.find(
|
|
130
|
+
(item) => item.id === activeItemName,
|
|
131
|
+
);
|
|
132
|
+
if (!activeItem)
|
|
133
|
+
activeItem = extensionConfig.items?.find((item) => item.isDefault);
|
|
134
|
+
|
|
135
|
+
const schemaEnhancer =
|
|
136
|
+
// For the main "variation" of blocks, allow simply passing a
|
|
137
|
+
// schemaEnhancer in the block configuration
|
|
138
|
+
activeItem?.['schemaEnhancer'] ||
|
|
139
|
+
(extensionName === 'variation' &&
|
|
140
|
+
blocksConfig?.[blockType]?.schemaEnhancer);
|
|
141
|
+
|
|
142
|
+
let schema = schemaEnhancer
|
|
143
|
+
? schemaEnhancer({
|
|
144
|
+
schema: cloneDeepSchema(originalSchema),
|
|
145
|
+
formData,
|
|
146
|
+
intl,
|
|
147
|
+
})
|
|
148
|
+
: cloneDeepSchema(originalSchema);
|
|
149
|
+
|
|
150
|
+
const { title = messages.variation, description } = extensionConfig;
|
|
151
|
+
|
|
152
|
+
if (extensionConfig.items?.length > 1) {
|
|
153
|
+
addExtensionFieldToSchema({
|
|
154
|
+
schema,
|
|
155
|
+
name: extensionName,
|
|
156
|
+
items: extensionConfig.items || [],
|
|
157
|
+
intl,
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
insertFieldToOrder,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
165
163
|
|
|
166
|
-
|
|
167
|
-
};
|
|
164
|
+
return <FormComponent {...props} schema={schema} />;
|
|
165
|
+
};
|
|
168
166
|
|
|
169
167
|
/**
|
|
170
168
|
* Apply block variation schema enhancers to the provided schema, using block
|
|
@@ -47,7 +47,8 @@ const widgetValidation = {
|
|
|
47
47
|
isValidEmail: (emailValue, emailObj, intlFunc) => {
|
|
48
48
|
// Email Regex taken from from WHATWG living standard:
|
|
49
49
|
// https://html.spec.whatwg.org/multipage/input.html#e-mail-state-(type=email)
|
|
50
|
-
const emailRegex =
|
|
50
|
+
const emailRegex =
|
|
51
|
+
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
51
52
|
const isValid = emailRegex.test(emailValue);
|
|
52
53
|
return !isValid ? intlFunc(messages.isValidEmail) : null;
|
|
53
54
|
},
|
|
@@ -70,11 +71,11 @@ const widgetValidation = {
|
|
|
70
71
|
isValidURL: (urlValue, urlObj, intlFunc) => {
|
|
71
72
|
var urlRegex = new RegExp(
|
|
72
73
|
'^(https?:\\/\\/)?' + // validate protocol
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
75
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))|' + // validate OR ip (v4) address
|
|
76
|
+
'(localhost)' + // validate OR localhost address
|
|
77
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
78
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
78
79
|
'(\\#[-a-z\\d_]*)?$', // validate fragment locator
|
|
79
80
|
'i',
|
|
80
81
|
);
|
|
@@ -87,14 +87,8 @@ class Html extends Component {
|
|
|
87
87
|
* @returns {string} Markup for the component.
|
|
88
88
|
*/
|
|
89
89
|
render() {
|
|
90
|
-
const {
|
|
91
|
-
|
|
92
|
-
markup,
|
|
93
|
-
store,
|
|
94
|
-
criticalCss,
|
|
95
|
-
apiPath,
|
|
96
|
-
publicURL,
|
|
97
|
-
} = this.props;
|
|
90
|
+
const { extractor, markup, store, criticalCss, apiPath, publicURL } =
|
|
91
|
+
this.props;
|
|
98
92
|
const head = Helmet.rewind();
|
|
99
93
|
const bodyClass = join(BodyClass.rewind(), ' ');
|
|
100
94
|
const htmlAttributes = head.htmlAttributes.toComponent();
|
|
@@ -18,22 +18,22 @@ export const __setLoadables = async () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// TODO: filter mockAllLoadables
|
|
21
|
-
export const injectLazyLibs = jest
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
export const injectLazyLibs = jest.fn().mockImplementation(function ([
|
|
22
|
+
libraries,
|
|
23
|
+
]) {
|
|
24
|
+
return jest.fn((WrappedComponent) =>
|
|
25
|
+
jest.fn((props) => {
|
|
26
|
+
return <WrappedComponent {...props} {...mockAllLoadables} />;
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
export const preloadLazyLibs = jest
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
export const preloadLazyLibs = jest.fn().mockImplementation(function ([
|
|
32
|
+
libraries,
|
|
33
|
+
]) {
|
|
34
|
+
return jest.fn((WrappedComponent) =>
|
|
35
|
+
jest.fn((props) => {
|
|
36
|
+
return <WrappedComponent {...props} />;
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
});
|
|
@@ -173,8 +173,7 @@ export const messages = defineMessages({
|
|
|
173
173
|
defaultMessage: 'Roles',
|
|
174
174
|
},
|
|
175
175
|
addUserFormPasswordAndSendPasswordTogetherNotAllowed: {
|
|
176
|
-
id:
|
|
177
|
-
'It is not allowed to define both the password and to request sending the password reset message by e-mail. You need to select one of them.',
|
|
176
|
+
id: 'It is not allowed to define both the password and to request sending the password reset message by e-mail. You need to select one of them.',
|
|
178
177
|
defaultMessage:
|
|
179
178
|
'It is not allowed to define both the password and to request sending the password reset message by e-mail. You need to select one of them.',
|
|
180
179
|
},
|
|
@@ -284,7 +283,7 @@ export const messages = defineMessages({
|
|
|
284
283
|
},
|
|
285
284
|
urlClipboardCopy: {
|
|
286
285
|
id: 'Link copied to clipboard',
|
|
287
|
-
defaultMessage: '
|
|
286
|
+
defaultMessage: 'Anchor link copied to the clipboard',
|
|
288
287
|
},
|
|
289
288
|
inspectRelations: {
|
|
290
289
|
id: 'Inspect relations',
|
|
@@ -171,9 +171,8 @@ WithPortal.args = {};
|
|
|
171
171
|
export const WithPortalAndPopper = StoryComponentWithPortalAndPopper.bind({});
|
|
172
172
|
WithPortalAndPopper.args = {};
|
|
173
173
|
|
|
174
|
-
export const WithPortalAndPopperUsingBlockChooser =
|
|
175
|
-
{}
|
|
176
|
-
);
|
|
174
|
+
export const WithPortalAndPopperUsingBlockChooser =
|
|
175
|
+
StoryComponentWithPortalAndPopper.bind({});
|
|
177
176
|
WithPortalAndPopperUsingBlockChooser.args = {
|
|
178
177
|
showBlockChooser: true,
|
|
179
178
|
};
|
|
@@ -284,6 +284,16 @@ export const reorderArray = (array, origin, target) => {
|
|
|
284
284
|
return result;
|
|
285
285
|
};
|
|
286
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Normalize (unicode) string to a normalized plain ascii string
|
|
289
|
+
* @method normalizeString
|
|
290
|
+
* @param {string} str The string to be normalized
|
|
291
|
+
* @returns {string} Normalized plain ascii string
|
|
292
|
+
*/
|
|
293
|
+
export function normalizeString(str) {
|
|
294
|
+
return str.normalize('NFD').replace(/\p{Diacritic}/gu, '');
|
|
295
|
+
}
|
|
296
|
+
|
|
287
297
|
/**
|
|
288
298
|
* Slugify a string: remove whitespaces, special chars and replace with _
|
|
289
299
|
* @param {string} string String to be slugified
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
safeWrapper,
|
|
15
15
|
slugify,
|
|
16
16
|
cloneDeepSchema,
|
|
17
|
+
normalizeString,
|
|
17
18
|
} from './Utils';
|
|
18
19
|
import moment from 'moment';
|
|
19
20
|
import deepFreeze from 'deep-freeze';
|
|
@@ -386,6 +387,18 @@ describe('Utils tests', () => {
|
|
|
386
387
|
});
|
|
387
388
|
});
|
|
388
389
|
|
|
390
|
+
describe('normalizeString', () => {
|
|
391
|
+
it('normalizeString no diacritics', () => {
|
|
392
|
+
const str = `my string without diacritics`;
|
|
393
|
+
expect(normalizeString(str)).toBe('my string without diacritics');
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it('normalizeString with diacritics', () => {
|
|
397
|
+
const str = `my Ü Ú é à ñ string with diacritics`;
|
|
398
|
+
expect(normalizeString(str)).toBe('my U U e a n string with diacritics');
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
|
|
389
402
|
describe('slugify', () => {
|
|
390
403
|
it('slugifies a standard string', () => {
|
|
391
404
|
expect(slugify('Content Type')).toBe('content_type');
|
package/src/helpers/index.js
CHANGED
package/src/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export useClipboard from '@plone/volto/hooks/clipboard/useClipboard';
|
|
1
|
+
export { default as useClipboard } from '@plone/volto/hooks/clipboard/useClipboard';
|
|
2
2
|
export { useClient } from '@plone/volto/hooks/client/useClient';
|