@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.
Files changed (154) hide show
  1. package/.eslintrc +26 -3
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  4. package/.yarn/releases/yarn-3.6.3.cjs +874 -0
  5. package/CHANGELOG.md +60 -0
  6. package/addon-registry.js +10 -1
  7. package/create-addons-loader.js +1 -1
  8. package/locales/ca/LC_MESSAGES/volto.po +57 -31
  9. package/locales/ca.json +1 -1
  10. package/locales/de/LC_MESSAGES/volto.po +58 -32
  11. package/locales/de.json +1 -1
  12. package/locales/en/LC_MESSAGES/volto.po +57 -31
  13. package/locales/en.json +1 -1
  14. package/locales/es/LC_MESSAGES/volto.po +65 -39
  15. package/locales/es.json +1 -1
  16. package/locales/eu/LC_MESSAGES/volto.po +57 -31
  17. package/locales/eu.json +1 -1
  18. package/locales/fi/LC_MESSAGES/volto.po +57 -31
  19. package/locales/fi.json +1 -1
  20. package/locales/fr/LC_MESSAGES/volto.po +57 -31
  21. package/locales/fr.json +1 -1
  22. package/locales/it/LC_MESSAGES/volto.po +57 -31
  23. package/locales/it.json +1 -1
  24. package/locales/ja/LC_MESSAGES/volto.po +57 -31
  25. package/locales/ja.json +1 -1
  26. package/locales/nl/LC_MESSAGES/volto.po +57 -31
  27. package/locales/nl.json +1 -1
  28. package/locales/pt/LC_MESSAGES/volto.po +57 -31
  29. package/locales/pt.json +1 -1
  30. package/locales/pt_BR/LC_MESSAGES/volto.po +57 -31
  31. package/locales/pt_BR.json +1 -1
  32. package/locales/ro/LC_MESSAGES/volto.po +57 -31
  33. package/locales/ro.json +1 -1
  34. package/locales/volto.pot +62 -32
  35. package/locales/zh_CN/LC_MESSAGES/volto.po +57 -31
  36. package/locales/zh_CN.json +1 -1
  37. package/package.json +35 -26
  38. package/packages/volto-slate/package.json +1 -1
  39. package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +2 -1
  40. package/packages/volto-slate/src/blocks/Text/index.js +0 -5
  41. package/packages/volto-slate/src/editor/plugins/Link/render.jsx +5 -6
  42. package/packages/volto-slate/src/editor/render.jsx +11 -1
  43. package/razzle.config.js +4 -6
  44. package/src/components/index.js +194 -194
  45. package/src/components/manage/Add/Add.jsx +7 -8
  46. package/src/components/manage/Blocks/Block/Settings.test.jsx +17 -15
  47. package/src/components/manage/Blocks/HTML/Edit.jsx +8 -8
  48. package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +30 -25
  49. package/src/components/manage/Blocks/Listing/ListingBody.jsx +6 -4
  50. package/src/components/manage/Blocks/Maps/Edit.test.jsx +1 -2
  51. package/src/components/manage/Blocks/Maps/View.test.jsx +1 -2
  52. package/src/components/manage/Blocks/Search/components/Facets.jsx +2 -3
  53. package/src/components/manage/Blocks/Search/components/FilterList.jsx +4 -6
  54. package/src/components/manage/Blocks/Search/components/SelectFacet.jsx +2 -9
  55. package/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +3 -0
  56. package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +8 -6
  57. package/src/components/manage/Blocks/Search/schema.js +13 -13
  58. package/src/components/manage/Blocks/Table/Cell.jsx +2 -3
  59. package/src/components/manage/Blocks/Text/Edit.jsx +2 -3
  60. package/src/components/manage/Blocks/Title/View.jsx +4 -37
  61. package/src/components/manage/Blocks/ToC/View.jsx +1 -0
  62. package/src/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +3 -2
  63. package/src/components/manage/Blocks/ToC/variations/HorizontalMenu.jsx +3 -2
  64. package/src/components/manage/Contents/Contents.jsx +252 -114
  65. package/src/components/manage/Contents/ContentsPropertiesModal.jsx +90 -154
  66. package/src/components/manage/Contents/ContentsRenameModal.jsx +88 -139
  67. package/src/components/manage/Contents/ContentsRenameModal.stories.jsx +61 -0
  68. package/src/components/manage/Contents/ContentsTagsModal.jsx +83 -130
  69. package/src/components/manage/Contents/ContentsTagsModal.stories.jsx +68 -0
  70. package/src/components/manage/Contents/ContentsUploadModal.jsx +1 -2
  71. package/src/components/manage/Contents/ContentsWorkflowModal.jsx +87 -154
  72. package/src/components/manage/Controlpanels/Aliases.jsx +4 -12
  73. package/src/components/manage/Controlpanels/Rules/AddRule.jsx +2 -9
  74. package/src/components/manage/Controlpanels/UndoControlpanel.jsx +6 -9
  75. package/src/components/manage/Form/BlockDataForm.test.jsx +17 -15
  76. package/src/components/manage/Form/Form.jsx +2 -3
  77. package/src/components/manage/Form/InlineForm.test.jsx +16 -14
  78. package/src/components/manage/LockingToastsFactory/LockingToastsFactory.jsx +1 -2
  79. package/src/components/manage/Sharing/Sharing.jsx +7 -0
  80. package/src/components/manage/Sidebar/Sidebar.jsx +139 -220
  81. package/src/components/manage/Toolbar/More.jsx +12 -12
  82. package/src/components/manage/Toolbar/PersonalTools.jsx +97 -155
  83. package/src/components/manage/Toolbar/Toolbar.jsx +2 -2
  84. package/src/components/manage/UniversalLink/UniversalLink.test.jsx +2 -1
  85. package/src/components/manage/Widgets/AlignWidget.jsx +2 -4
  86. package/src/components/manage/Widgets/ColorPickerWidget.test.jsx +9 -7
  87. package/src/components/manage/Widgets/DatetimeWidget.jsx +2 -8
  88. package/src/components/manage/Widgets/IdWidget.jsx +1 -2
  89. package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +2 -9
  90. package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +2 -9
  91. package/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +4 -4
  92. package/src/components/manage/Widgets/SchemaWidget.jsx +6 -9
  93. package/src/components/manage/Widgets/WysiwygWidget.jsx +2 -9
  94. package/src/components/theme/Comments/Comments.jsx +3 -10
  95. package/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +4 -0
  96. package/src/components/theme/Login/Login.jsx +1 -2
  97. package/src/components/theme/PasswordReset/PasswordReset.jsx +1 -2
  98. package/src/components/theme/PreviewImage/PreviewImage.jsx +10 -5
  99. package/src/components/theme/PreviewImage/PreviewImage.test.js +17 -0
  100. package/src/components/theme/Register/Register.jsx +2 -4
  101. package/src/components/theme/TsTest/TsTest.test.tsx +11 -0
  102. package/src/components/theme/TsTest/TsTest.tsx +15 -0
  103. package/src/components/theme/View/AlbumView.jsx +3 -2
  104. package/src/components/theme/Widgets/ImageWidget.stories.jsx +1 -2
  105. package/src/config/Loadables.jsx +1 -1
  106. package/src/config/RichTextEditor/Blocks.jsx +2 -3
  107. package/src/config/RichTextEditor/Plugins.jsx +2 -3
  108. package/src/config/RichTextEditor/ToHTML.jsx +12 -10
  109. package/src/config/RichTextEditor/index.js +2 -3
  110. package/src/config/Views.jsx +5 -5
  111. package/src/express-middleware/ok.js +1 -1
  112. package/src/helpers/Blocks/Blocks.js +4 -6
  113. package/src/helpers/Blocks/Blocks.test.js +35 -35
  114. package/src/helpers/Extensions/withBlockSchemaEnhancer.js +48 -50
  115. package/src/helpers/FormValidation/FormValidation.js +7 -6
  116. package/src/helpers/Html/Html.jsx +2 -8
  117. package/src/helpers/Loadable/__mocks__/Loadable.js +18 -18
  118. package/src/helpers/MessageLabels/MessageLabels.js +2 -3
  119. package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +2 -3
  120. package/src/helpers/Utils/Utils.js +10 -0
  121. package/src/helpers/Utils/Utils.test.js +13 -0
  122. package/src/helpers/index.js +1 -0
  123. package/src/hooks/index.js +1 -1
  124. package/src/middleware/api.js +194 -190
  125. package/src/middleware/blacklistRoutes.js +25 -22
  126. package/src/middleware/storeProtectLoadUtils.js +61 -62
  127. package/src/middleware/storeProtectLoadUtils.test.js +47 -43
  128. package/src/reducers/content/content.test.js +4 -4
  129. package/src/reducers/navigation/navigation.js +5 -5
  130. package/src/reducers/navigation/navigation.test.js +30 -0
  131. package/src/registry.js +2 -2
  132. package/src/storybook.jsx +24 -38
  133. package/theme/themes/pastanaga/collections/menu.overrides +3 -2
  134. package/theme/themes/pastanaga/elements/container.overrides +5 -2
  135. package/theme/themes/pastanaga/elements/input.overrides +1 -1
  136. package/theme/themes/pastanaga/elements/step.overrides +2 -1
  137. package/theme/themes/pastanaga/extras/blocks.less +20 -14
  138. package/theme/themes/pastanaga/extras/color-picker-widget.less +1 -1
  139. package/theme/themes/pastanaga/extras/contents.less +5 -1
  140. package/theme/themes/pastanaga/extras/draftjs.less +4 -4
  141. package/theme/themes/pastanaga/extras/grid.less +5 -4
  142. package/theme/themes/pastanaga/extras/main.less +6 -6
  143. package/theme/themes/pastanaga/extras/react-dates-overrides.less +4 -2
  144. package/theme/themes/pastanaga/extras/search.less +2 -2
  145. package/theme/themes/pastanaga/extras/sidebar.less +5 -4
  146. package/theme/themes/pastanaga/extras/time-picker-overrides.less +5 -3
  147. package/theme/themes/pastanaga/extras/toolbar.less +6 -2
  148. package/theme/themes/pastanaga/extras/userscontrolpanel.less +17 -9
  149. package/theme/themes/pastanaga/extras/widgets.less +1 -1
  150. package/theme/themes/pastanaga/modules/rating.overrides +2 -1
  151. package/theme/themes/pastanaga-cms-ui/elements/container.overrides +2 -1
  152. package/theme/themes/pastanaga-cms-ui/extras/cms-ui.elements.container.less +6 -2
  153. package/theme/themes/pastanaga-cms-ui/extras/cms-ui.site.less +2 -2
  154. 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({ name: 'PreviewImage' })
67
- .component;
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
- 'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAKlUlEQVR4nOSbf2xT19nHv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y64hCgq2Uaw4g05HH0cTstKiijpalyBNbMXM4kJjaouyCe4T6IXGIjVFT7/hQt7t5LXP9jDzVBXU7aFmKFF7nsFAEqYxRP2svjx+i24K69yXewIBg41XGO8Dr9NPaWxYanZnW5MjNCh7HLiV6UwbtHyiWiYboVNmwRbJoitg2obh6crLTsWG9xJ4aaEHS0zWvSyrT3fw7GrryEgocgaNTeSoczdM1bwgBF+sex6htE5hcIjN24RLOftaH+0uWMIuk0rOKoM+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
  },
@@ -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/parser-html')),
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 = DefaultDraftBlockRenderMap.merge(
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 = draftJsBlockBreakoutPlugin.default(
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 = (ordered) => (children, { depth, keys }) =>
105
- ordered ? (
106
- <ol key={keys[0]} keys={keys} depth={depth}>
107
- {splitSoftLinesOfLists(children)}
108
- </ol>
109
- ) : (
110
- <ul key={keys[0]} keys={keys} depth={depth}>
111
- {splitSoftLinesOfLists(children)}
112
- </ul>
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 } = Blocks(
9
- props,
10
- );
8
+ const { extendedBlockRenderMap, blockStyleFn, listBlockTypes } =
9
+ Blocks(props);
11
10
 
12
11
  return {
13
12
  extendedBlockRenderMap,
@@ -111,11 +111,11 @@ export const contentTypesViews = {
111
111
  export const defaultView = DefaultView;
112
112
 
113
113
  export const errorViews = {
114
- '404': NotFoundView,
115
- '401': Unauthorized,
116
- '403': Forbidden,
117
- '408': RequestTimeout,
118
- '500': ServerError,
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 = formData[blocksLayoutFieldname].items.indexOf(
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 = formData[blocksLayoutFieldname].items.indexOf(
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
- '1': {
591
+ 1: {
592
592
  blocks: {
593
- '2': {},
594
- '3': {
593
+ 2: {},
594
+ 3: {
595
595
  data: {
596
596
  blocks: {
597
- '11': {},
598
- '12': {},
599
- '13': {},
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
- '7': {
606
+ 7: {
607
607
  blocks: {
608
- '8': {},
609
- '9': {},
610
- '10': {},
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
- '4': {
621
+ 4: {
622
622
  blocks: {
623
- '5': {},
624
- '6': {},
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
- '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' },
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
- '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' },
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
- '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' },
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
- '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': {
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
- '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' },
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
- extensionName = 'vendor',
116
- insertFieldToOrder = _addField,
117
- ) => ({ ...props }) => {
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
- const blocksConfig = getBlocksConfig(props);
119
+ const blocksConfig = getBlocksConfig(props);
122
120
 
123
- const blockType = formData['@type'];
124
- const extensionConfig =
125
- blocksConfig?.[blockType]?.extensions?.[extensionName];
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
- const { title = messages.variation, description } = extensionConfig;
125
+ if (!extensionConfig)
126
+ return <FormComponent {...props} schema={originalSchema} />;
153
127
 
154
- if (extensionConfig.items?.length > 1) {
155
- addExtensionFieldToSchema({
156
- schema,
157
- name: extensionName,
158
- items: extensionConfig.items || [],
159
- intl,
160
- title,
161
- description,
162
- insertFieldToOrder,
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
- return <FormComponent {...props} schema={schema} />;
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 = /^[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])?)*$/;
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
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
74
- '((\\d{1,3}\\.){3}\\d{1,3}))|' + // validate OR ip (v4) address
75
- '(localhost)' + // validate OR localhost address
76
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
77
- '(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
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
- extractor,
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
- .fn()
23
- .mockImplementation(function ([libraries]) {
24
- return jest.fn((WrappedComponent) =>
25
- jest.fn((props) => {
26
- return <WrappedComponent {...props} {...mockAllLoadables} />;
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
- .fn()
33
- .mockImplementation(function ([libraries]) {
34
- return jest.fn((WrappedComponent) =>
35
- jest.fn((props) => {
36
- return <WrappedComponent {...props} />;
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: 'Link copied to clipboard',
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 = StoryComponentWithPortalAndPopper.bind(
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');
@@ -95,6 +95,7 @@ export {
95
95
  reorderArray,
96
96
  isInteractiveElement,
97
97
  slugify,
98
+ normalizeString,
98
99
  } from '@plone/volto/helpers/Utils/Utils';
99
100
  export { messages } from './MessageLabels/MessageLabels';
100
101
  export {
@@ -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';