@eeacms/volto-cca-policy 0.3.131 → 1.0.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 (181) hide show
  1. package/.eslintrc.js +7 -7
  2. package/CHANGELOG.md +9 -14
  3. package/docker-compose.yml +16 -16
  4. package/jest-addon.config.js +25 -420
  5. package/package.json +1 -1
  6. package/src/components/MigrationButtons.jsx +5 -1
  7. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationEdit.jsx +2 -1
  8. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.jsx +10 -4
  9. package/src/components/manage/Blocks/ASTNavigation/ASTNavigationView.test.jsx +87 -35
  10. package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockEdit.jsx +1 -1
  11. package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockView.test.jsx +1 -1
  12. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockEdit.jsx +1 -1
  13. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.jsx +1 -1
  14. package/src/components/manage/Blocks/C3SIndicatorsListingBlock/C3SIndicatorsListingBlockView.test.jsx +1 -1
  15. package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockEdit.jsx +1 -1
  16. package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/schema.js +0 -20
  17. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerEdit.test.jsx +1 -1
  18. package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerView.js → CaseStudyExplorerView.jsx} +1 -1
  19. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyExplorerView.test.jsx +2 -2
  20. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyFilters.test.jsx +1 -1
  21. package/src/components/manage/Blocks/CaseStudyExplorer/CaseStudyMap.test.jsx +1 -1
  22. package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.jsx +2 -1
  23. package/src/components/manage/Blocks/CaseStudyExplorer/FeatureDisplay.test.jsx +1 -1
  24. package/src/components/manage/Blocks/CaseStudyExplorer/styles.less +0 -4
  25. package/src/components/manage/Blocks/CaseStudyExplorer/utils.js +0 -30
  26. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsEdit.jsx +1 -1
  27. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.jsx +3 -2
  28. package/src/components/manage/Blocks/CollectionStatistics/CollectionStatsView.test.jsx +1 -1
  29. package/src/components/manage/Blocks/ContentLinks/ContentLinksEdit.jsx +1 -1
  30. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.jsx +1 -1
  31. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.test.jsx +1 -1
  32. package/src/components/manage/Blocks/ContentLinks/DropdownListView.jsx +1 -1
  33. package/src/components/manage/Blocks/ContentLinks/DropdownListView.test.jsx +1 -1
  34. package/src/components/manage/Blocks/CountryMapHeatIndex/Filter.test.jsx +1 -1
  35. package/src/components/manage/Blocks/CountryMapHeatIndex/{View.js → View.jsx} +14 -10
  36. package/src/components/manage/Blocks/CountryMapHeatIndex/mapstyle.js +1 -3
  37. package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryEdit.jsx +2 -1
  38. package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +4 -3
  39. package/src/components/manage/Blocks/CountryMapProfile/Filter.test.jsx +1 -1
  40. package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +5 -12
  41. package/src/components/manage/Blocks/CountryProfileDetail/{CountryTabPane.js → CountryTabPane.jsx} +11 -4
  42. package/src/components/manage/Blocks/CountryProfileDetail/CountryTabPane.test.jsx +1 -1
  43. package/src/components/manage/Blocks/CountryProfileDetail/{View.js → View.jsx} +20 -15
  44. package/src/components/manage/Blocks/CountryProfileDetail/View.test.jsx +134 -20
  45. package/src/components/manage/Blocks/CountryProfileDetail/index.js +0 -1
  46. package/src/components/manage/Blocks/DataConnectedEmbedBlock/index.js +0 -2
  47. package/src/components/manage/Blocks/ECDEIndicators/ECDEIndicatorsView.jsx +1 -1
  48. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentEdit.jsx +3 -3
  49. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.jsx +2 -2
  50. package/src/components/manage/Blocks/FilterAceContent/FilterAceContentView.test.jsx +1 -1
  51. package/src/components/manage/Blocks/FlourishEmbedBlock/FlourishEmbedBlockEdit.jsx +1 -1
  52. package/src/components/manage/Blocks/Listing/DropdownListingView.jsx +1 -1
  53. package/src/components/manage/Blocks/Listing/EventAccordionListingView.jsx +1 -1
  54. package/src/components/manage/Blocks/Listing/EventAccordionListingView.test.jsx +5 -3
  55. package/src/components/manage/Blocks/Listing/EventCardsListingView.jsx +2 -1
  56. package/src/components/manage/Blocks/Listing/EventCardsListingView.test.jsx +10 -4
  57. package/src/components/manage/Blocks/Listing/IndicatorCardsListingView.jsx +2 -2
  58. package/src/components/manage/Blocks/Listing/OrganisationCardsListingView.jsx +3 -1
  59. package/src/components/manage/Blocks/Listing/SimpleCardsListingView.jsx +1 -1
  60. package/src/components/manage/Blocks/Listing/SimpleCardsListingView.test.jsx +5 -3
  61. package/src/components/manage/Blocks/Listing/SimpleItemListingView.jsx +2 -2
  62. package/src/components/manage/Blocks/Listing/SimpleItemListingView.test.jsx +6 -4
  63. package/src/components/manage/Blocks/RASTBlock/ContextNavigation.jsx +0 -1
  64. package/src/components/manage/Blocks/RASTBlock/RASTAccordion.jsx +1 -1
  65. package/src/components/manage/Blocks/RASTBlock/RASTAccordion.test.jsx +1 -1
  66. package/src/components/manage/Blocks/RASTBlock/RASTAccordionContent.jsx +2 -2
  67. package/src/components/manage/Blocks/RASTBlock/RASTEdit.jsx +1 -1
  68. package/src/components/manage/Blocks/RASTBlock/RASTMap.jsx +1 -1
  69. package/src/components/manage/Blocks/RASTBlock/RASTMap.test.jsx +1 -1
  70. package/src/components/manage/Blocks/RASTBlock/RASTView.jsx +1 -1
  71. package/src/components/manage/Blocks/ReadMore/ReadMoreEdit.jsx +1 -1
  72. package/src/components/manage/Blocks/ReadMore/ReadMoreView.jsx +1 -1
  73. package/src/components/manage/Blocks/ReadMore/ReadMoreView.test.jsx +1 -1
  74. package/src/components/manage/Blocks/RedirectBlock/{RedirectBlock.test.js → RedirectBlock.test.jsx} +1 -1
  75. package/src/components/manage/Blocks/RedirectBlock/RedirectBlockEdit.jsx +2 -1
  76. package/src/components/manage/Blocks/RedirectBlock/RedirectBlockView.jsx +2 -2
  77. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentEdit.jsx +1 -1
  78. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.jsx +1 -1
  79. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.test.jsx +1 -1
  80. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentEdit.jsx +1 -1
  81. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.jsx +1 -1
  82. package/src/components/manage/Blocks/SearchAceContent/SearchAceContentView.test.jsx +1 -1
  83. package/src/components/manage/Blocks/TabsBlock/Spotlight.jsx +2 -2
  84. package/src/components/manage/Blocks/TabsBlock/Spotlight.test.jsx +7 -1
  85. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectEdit.jsx +1 -1
  86. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.jsx +1 -1
  87. package/src/components/manage/Blocks/TransRegionSelect/TransRegionSelectView.test.jsx +1 -1
  88. package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.jsx +5 -2
  89. package/src/components/manage/CreateArchivedCopyButton/CreateArchivedCopyButton.test.jsx +3 -6
  90. package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.jsx +1 -1
  91. package/src/components/manage/Workflow/WorkflowLinkIntegrityModal.test.jsx +1 -1
  92. package/src/components/theme/ASTNavigation/ASTAccordion.test.jsx +1 -1
  93. package/src/components/theme/ASTNavigation/ASTLogoMap.jsx +1 -1
  94. package/src/components/theme/ASTNavigation/ASTLogoMap.test.jsx +1 -1
  95. package/src/components/theme/ASTNavigation/ASTNavigation.jsx +9 -5
  96. package/src/components/theme/ASTNavigation/ASTNavigation.test.jsx +323 -0
  97. package/src/components/theme/ASTNavigation/{utils.js → LinkWrap.jsx} +4 -9
  98. package/src/components/theme/ASTNavigation/UASTLogoMap.jsx +1 -1
  99. package/src/components/theme/ASTNavigation/UASTLogoMap.test.jsx +1 -1
  100. package/src/components/theme/Header/Header.jsx +5 -5
  101. package/src/components/theme/Header/LanguageSwitch.jsx +5 -5
  102. package/src/components/theme/MissionSignatoryProfile/MissionSignatoryProfileView.jsx +1 -1
  103. package/src/components/theme/TranslationDisclaimer/TranslationDisclaimer.jsx +1 -1
  104. package/src/components/theme/TranslationDisclaimer/TranslationInfo.jsx +1 -1
  105. package/src/components/theme/Views/AdaptationOptionView.jsx +1 -1
  106. package/src/components/theme/Views/AdaptationOptionView.test.jsx +5 -3
  107. package/src/components/theme/Views/ArchivedVersionListing.jsx +1 -1
  108. package/src/components/theme/Views/ArchivedVersionListing.test.jsx +2 -2
  109. package/src/components/theme/Views/ArchivedVersionNotice.jsx +1 -1
  110. package/src/components/theme/Views/ArchivedVersionNotice.test.jsx +1 -1
  111. package/src/components/theme/Views/BrokenLinks.jsx +1 -1
  112. package/src/components/theme/Views/BrokenLinks.test.jsx +1 -1
  113. package/src/components/theme/Views/CaseStudyView.test.jsx +1 -1
  114. package/src/components/theme/Views/DatabaseItemView.test.jsx +1 -1
  115. package/src/components/theme/Views/NewsItemView.jsx +1 -1
  116. package/src/components/theme/Views/ProjectView.test.jsx +1 -1
  117. package/src/components/theme/Views/VersionsGroup.jsx +1 -1
  118. package/src/components/theme/Views/VersionsGroup.test.jsx +1 -1
  119. package/src/components/theme/Widgets/GeocharsWidget.jsx +1 -1
  120. package/src/components/theme/Widgets/GeolocationWidget.jsx +1 -1
  121. package/src/components/theme/Widgets/GeolocationWidget.test.jsx +1 -1
  122. package/src/components/theme/Widgets/ImageWidget.jsx +7 -8
  123. package/src/components/theme/Widgets/ImageWidget.test.jsx +1 -1
  124. package/src/components/theme/Widgets/PromotionalImageWidget.jsx +6 -4
  125. package/src/components/theme/Widgets/utils.js +1 -1
  126. package/src/constants.js +538 -2
  127. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +1 -1
  128. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +52 -24
  129. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +1 -0
  130. package/src/customizations/@eeacms/volto-eea-website-theme/components/theme/DraftBackground/DraftBackground.jsx +2 -1
  131. package/src/customizations/@eeacms/volto-listing-block/blocks/Listing/item-templates/SimpleItemTemplates.jsx +2 -2
  132. package/src/customizations/@eeacms/volto-listing-block/components/UniversalCard/fragments/CardTitle.jsx +1 -1
  133. package/src/customizations/@plone/volto-slate/blocks/Table/TableBlockView.jsx +3 -3
  134. package/src/customizations/@plone/volto-slate/blocks/Text/{index.js → index.jsx} +2 -21
  135. package/src/customizations/@plone/volto-slate/editor/extensions/normalizeNode.js +1 -1
  136. package/src/customizations/@plone/volto-slate/utils/blocks.js +11 -8
  137. package/src/customizations/@plone/volto-slate/utils/volto-blocks.js +2 -2
  138. package/src/customizations/@plone/volto-slate/widgets/HtmlSlateWidget.jsx +2 -2
  139. package/src/customizations/@plone-collective/volto-authomatic/components/Login/Login.jsx +7 -4
  140. package/src/customizations/@plone-collective/volto-rss-provider/components/RSSFeedView.jsx +5 -8
  141. package/src/customizations/@plone-collective/volto-rss-provider/express-middleware.js +2 -1
  142. package/src/customizations/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +3 -3
  143. package/src/customizations/volto/components/manage/Blocks/Grid/templates.js +1 -1
  144. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +1 -1
  145. package/src/customizations/volto/components/manage/Controlpanels/ContentTypeLayout.jsx +12 -14
  146. package/src/customizations/volto/components/manage/Display/Display.jsx +10 -5
  147. package/src/customizations/volto/components/manage/Multilingual/TranslationObject.jsx +7 -6
  148. package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +4 -1
  149. package/src/customizations/volto/components/manage/Workflow/Workflow.jsx +12 -8
  150. package/src/customizations/volto/components/theme/App/App.jsx +16 -23
  151. package/src/customizations/volto/components/theme/Sitemap/Sitemap.jsx +3 -2
  152. package/src/customizations/volto/components/theme/View/DefaultView.jsx +5 -4
  153. package/src/customizations/volto/components/theme/View/LinkView.jsx +2 -2
  154. package/src/customizations/volto/components/theme/View/View.jsx +10 -11
  155. package/src/customizations/volto/helpers/Url/Url-old.js +2 -1
  156. package/src/customizations/volto/middleware/api.js +6 -4
  157. package/src/customizations/volto/reducers/actions/actions.js +2 -5
  158. package/src/customizations/volto/reducers/breadcrumbs/breadcrumbs.js +3 -6
  159. package/src/customizations/volto/reducers/navigation/navigation.js +3 -6
  160. package/src/customizations/volto/server.jsx +9 -8
  161. package/src/express-middleware.js +1 -1
  162. package/src/helpers/ContentMetadata.jsx +4 -4
  163. package/src/helpers/Utils.jsx +5 -5
  164. package/src/helpers/index.js +1 -8
  165. package/src/hocs/index.js +2 -0
  166. package/src/index.js +9 -7
  167. package/src/search/common.js +4 -41
  168. package/src/search/utils.test.js +1 -1
  169. package/src/search/vocabulary.js +2 -2
  170. package/src/store/reducers/physical-breadcrumbs.js +2 -2
  171. package/src/utils.js +1 -1
  172. package/src/helpers/Constants.jsx +0 -535
  173. package/theme/assets/images/administrative_support_service.png +0 -0
  174. /package/src/components/manage/Blocks/CaseStudyExplorer/{CaseStudyExplorerEdit.js → CaseStudyExplorerEdit.jsx} +0 -0
  175. /package/src/components/manage/Blocks/CountryMapHeatIndex/{Edit.js → Edit.jsx} +0 -0
  176. /package/src/components/manage/Blocks/CountryMapProfile/{Edit.js → Edit.jsx} +0 -0
  177. /package/src/components/manage/Blocks/CountryProfileDetail/{Edit.js → Edit.jsx} +0 -0
  178. /package/src/components/manage/Blocks/ReadMore/{schema.js → schema.jsx} +0 -0
  179. /package/src/helpers/{clientOnly.js → clientOnly.jsx} +0 -0
  180. /package/src/{components/manage/Blocks/withResponsiveContainer.js → hocs/withResponsiveContainer.jsx} +0 -0
  181. /package/src/{components/manage/Blocks → hocs}/withVisibilitySensor.jsx +0 -0
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/jsx-filename-extension */
1
2
  import React, { useEffect, useState } from 'react';
2
3
  import {
3
4
  Accordion,
@@ -8,9 +9,18 @@ import {
8
9
  Transition,
9
10
  } from 'semantic-ui-react';
10
11
 
11
- import { cloneDeep } from 'lodash';
12
+ import cloneDeep from 'lodash/cloneDeep';
13
+ import kebabCase from 'lodash/kebabCase';
12
14
 
13
15
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
16
+ import { numbersToMenuItemColumns } from '@eeacms/volto-eea-design-system/ui/Header/utils';
17
+
18
+ const generateCssClassFromUrl = (url) => {
19
+ if (!url) return '';
20
+ return kebabCase(
21
+ url.replace(/\//g, '-').replace(/\./g, '-').replace(/@/g, '-'),
22
+ );
23
+ };
14
24
 
15
25
  const createColumns = (item, renderMenuItem, item_id) => {
16
26
  return item.items.map((item, index) => (
@@ -30,7 +40,8 @@ const ItemGrid = ({
30
40
  renderMenuItem,
31
41
  // hideChildrenFromNavigation,
32
42
  }) => {
33
- const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
43
+ const item_id =
44
+ item?.title?.toLowerCase()?.replaceAll(' ', '-') + '-sub-title';
34
45
  return (
35
46
  <>
36
47
  {renderMenuItem(item, { className: 'sub-title', id: item_id })}
@@ -53,14 +64,14 @@ const Item = ({
53
64
  renderMenuItem,
54
65
  // hideChildrenFromNavigation,
55
66
  }) => {
56
- const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
67
+ const item_id =
68
+ item?.title?.toLowerCase()?.replaceAll(' ', '-') + '-sub-title';
57
69
  return (
58
70
  <>
59
71
  {renderMenuItem(item, {
60
72
  className: 'sub-title',
61
73
  id: item_id,
62
74
  })}
63
-
64
75
  <List className="menu-list" aria-labelledby={item_id}>
65
76
  {item.items.map((listItem, index) => (
66
77
  <React.Fragment key={index}>
@@ -117,17 +128,31 @@ export const StandardMegaMenuGrid = ({ menuItem, renderMenuItem, layout }) => {
117
128
 
118
129
  const renderColumns = () => (
119
130
  <Grid>
120
- {menuItemColumns.map((section, columnIndex) => (
121
- <div className={layout.menuItemColumns[columnIndex]} key={columnIndex}>
122
- {columnIndex !== menuItemColumnsLength
123
- ? renderColumnContent(menuItem.items[columnIndex], columnIndex)
124
- : menuItem.items
125
- .slice(menuItemColumnsLength)
126
- .map((section, _idx) =>
127
- renderColumnContent(section, columnIndex),
128
- )}
129
- </div>
130
- ))}
131
+ {menuItemColumns.map((section, columnIndex) => {
132
+ const sectionItem =
133
+ columnIndex !== menuItemColumnsLength
134
+ ? menuItem.items[columnIndex]
135
+ : menuItem.items.slice(menuItemColumnsLength)[0];
136
+ const urlClass = sectionItem?.url
137
+ ? generateCssClassFromUrl(sectionItem.url)
138
+ : '';
139
+ const classNames = `${numbersToMenuItemColumns(
140
+ layout.menuItemColumns[columnIndex],
141
+ )}${urlClass ? ` ${urlClass}` : ''}`;
142
+ return (
143
+ <div className={classNames} key={columnIndex + '-column'}>
144
+ {columnIndex !== menuItemColumnsLength
145
+ ? renderColumnContent(menuItem.items[columnIndex], columnIndex)
146
+ : menuItem.items
147
+ .slice(menuItemColumnsLength)
148
+ .map((section, _idx) => (
149
+ <React.Fragment key={`${columnIndex}-${_idx}`}>
150
+ {renderColumnContent(section, columnIndex)}
151
+ </React.Fragment>
152
+ ))}
153
+ </div>
154
+ );
155
+ })}
131
156
  </Grid>
132
157
  );
133
158
 
@@ -199,10 +224,10 @@ const FirstLevelContent = ({ element, renderMenuItem, pathName }) => {
199
224
  firstLevelPanels.push(x);
200
225
  return (
201
226
  <Accordion.Accordion
202
- className={'ui'}
203
227
  panels={firstLevelPanels}
204
228
  key={index}
205
229
  defaultActiveIndex={defaultIndex === index ? 0 : -1}
230
+ className={'ui'}
206
231
  />
207
232
  );
208
233
  })}
@@ -225,7 +250,7 @@ const SecondLevelContent = ({ element, topics = false, renderMenuItem }) => {
225
250
  (element) => element.title === 'At a glance',
226
251
  );
227
252
  const inDepth = element.items.find(
228
- (element) => element.url.indexOf('in-depth') !== -1,
253
+ (element) => element.url && element.url.indexOf('in-depth') !== -1,
229
254
  );
230
255
  content = (
231
256
  <List>
@@ -288,9 +313,7 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
288
313
  aria-expanded={activeIndex === index}
289
314
  as="button"
290
315
  onClick={() => {
291
- if (activeIndex === index) {
292
- setActiveIndex(-1);
293
- } else setActiveIndex(index);
316
+ setActiveIndex(activeIndex === index ? -1 : index);
294
317
  }}
295
318
  >
296
319
  {element.title}
@@ -346,14 +369,19 @@ function HeaderMenuPopUp({
346
369
  const menuItem = menuItems.find(
347
370
  (current) => current.url === activeItem || current['@id'] === activeItem,
348
371
  );
349
-
372
+ // Get layout for current menu item and fallback to a * layout that can
373
+ // be used for all menu items that don't have a specific layout
350
374
  const layout =
351
375
  (!!menuItemsLayouts &&
352
- Object.keys(menuItemsLayouts).includes(menuItem?.url) &&
353
- menuItemsLayouts[menuItem.url]) ||
376
+ menuItem?.items?.length > 0 &&
377
+ (menuItemsLayouts[menuItem?.url] ||
378
+ menuItemsLayouts[
379
+ Object.keys(menuItemsLayouts).find((key) =>
380
+ menuItem?.url?.includes(key),
381
+ )
382
+ ])) ||
354
383
  (!!menuItemsLayouts && menuItemsLayouts['*']) ||
355
384
  {};
356
-
357
385
  return (
358
386
  <Transition visible={visible} animation="slide down" duration={300}>
359
387
  <div id="mega-menu" ref={nodeRef}>
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/jsx-filename-extension */
1
2
  import React, { useEffect } from 'react';
2
3
  import { Container, Input, List } from 'semantic-ui-react';
3
4
  import { withRouter, Link } from 'react-router-dom';
@@ -1,4 +1,5 @@
1
- import { BodyClass, flattenToAppURL } from '@plone/volto/helpers';
1
+ import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
2
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
2
3
  import { connect } from 'react-redux';
3
4
  import { withRouter } from 'react-router-dom';
4
5
  import { compose } from 'redux';
@@ -1,6 +1,6 @@
1
1
  import cx from 'classnames';
2
- import { ConditionalLink } from '@plone/volto/components';
3
- import { getBaseUrl } from '@plone/volto/helpers';
2
+ import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
3
+ import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
4
4
  import { getVoltoStyles } from '@eeacms/volto-listing-block/schema-utils';
5
5
 
6
6
  const getStyles = (props) => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Card as UiCard } from 'semantic-ui-react';
3
- import { ConditionalLink } from '@plone/volto/components';
3
+ import ConditionalLink from '@plone/volto/components/manage/ConditionalLink/ConditionalLink';
4
4
 
5
5
  const getItemHref = (item) =>
6
6
  item?.linkHref || item?.linkWithHash || item?.['@id'];
@@ -10,7 +10,7 @@
10
10
  import React, { useState, useMemo } from 'react';
11
11
  import PropTypes from 'prop-types';
12
12
  import { Table } from 'semantic-ui-react';
13
- import { map } from 'lodash';
13
+ import map from 'lodash/map';
14
14
  import {
15
15
  serializeNodes,
16
16
  serializeNodesToText,
@@ -100,8 +100,8 @@ const View = ({ data }) => {
100
100
  state.column !== index
101
101
  ? 'ascending'
102
102
  : state.direction === 'ascending'
103
- ? 'descending'
104
- : 'ascending',
103
+ ? 'descending'
104
+ : 'ascending',
105
105
  });
106
106
  }}
107
107
  >
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import redraft from 'redraft';
3
2
  import TextBlockView from '@plone/volto-slate/blocks/Text/TextBlockView';
4
3
  import TextBlockEdit from '@plone/volto-slate/blocks/Text/TextBlockEdit';
5
4
  import TextBlockSchema from '@plone/volto-slate/blocks/Text/TextBlockSchema';
@@ -129,26 +128,8 @@ export default function installTextBlock(config) {
129
128
  return override_toc && level
130
129
  ? [parseInt(level.slice(1)), entry_text]
131
130
  : config.settings.slate.topLevelTargetElements.includes(type)
132
- ? [parseInt(type.slice(1)), plaintext]
133
- : null;
134
- },
135
- };
136
-
137
- // Make draft js compatible with ToC
138
- config.blocks.blocksConfig.text = {
139
- ...config.blocks.blocksConfig.text,
140
- restricted: true,
141
- tocEntry: (block = {}) => {
142
- const draft = redraft(
143
- block.text,
144
- config.settings.richtextViewSettings.ToHTMLRenderers,
145
- config.settings.richtextViewSettings.ToHTMLOptions,
146
- );
147
- const type = draft?.[0]?.[0]?.type;
148
-
149
- return config.settings.slate.topLevelTargetElements.includes(type)
150
- ? [parseInt(type.slice(1)), block.text.blocks[0].text]
151
- : null;
131
+ ? [parseInt(type.slice(1)), plaintext]
132
+ : null;
152
133
  },
153
134
  };
154
135
 
@@ -1,6 +1,6 @@
1
1
  import { Text, Transforms, Element, Node, Path } from 'slate'; // Editor,
2
2
  import config from '@plone/volto/registry';
3
- import { isEqual } from 'lodash';
3
+ import isEqual from 'lodash/isEqual';
4
4
 
5
5
  const hasNoText = (node) => {
6
6
  const texts = Array.from(Node.texts(node));
@@ -4,8 +4,11 @@ import config from '@plone/volto/registry';
4
4
  import {
5
5
  getBlocksFieldname,
6
6
  getBlocksLayoutFieldname,
7
- } from '@plone/volto/helpers';
8
- import _ from 'lodash';
7
+ } from '@plone/volto/helpers/Blocks/Blocks';
8
+ import find from 'lodash/find';
9
+ import includes from 'lodash/includes';
10
+ import some from 'lodash/some';
11
+ import first from 'lodash/first';
9
12
  import { makeEditor } from '@plone/volto-slate/utils/editor';
10
13
 
11
14
  // case sensitive; first in an inner array is the default and preffered format
@@ -141,10 +144,10 @@ export const isSingleBlockTypeActive = (editor, format) => {
141
144
  };
142
145
 
143
146
  export const isBlockActive = (editor, format) => {
144
- const aliasList = _.find(formatAliases, (x) => _.includes(x, format));
147
+ const aliasList = find(formatAliases, (x) => includes(x, format));
145
148
 
146
149
  if (aliasList) {
147
- const aliasFound = _.some(aliasList, (y) => {
150
+ const aliasFound = some(aliasList, (y) => {
148
151
  return isSingleBlockTypeActive(editor, y);
149
152
  });
150
153
 
@@ -159,17 +162,17 @@ export const isBlockActive = (editor, format) => {
159
162
  export const getBlockTypeContextData = (editor, format) => {
160
163
  let isActive, defaultFormat, matcher;
161
164
 
162
- const aliasList = _.find(formatAliases, (x) => _.includes(x, format));
165
+ const aliasList = find(formatAliases, (x) => includes(x, format));
163
166
 
164
167
  if (aliasList) {
165
- const aliasFound = _.some(aliasList, (y) => {
168
+ const aliasFound = some(aliasList, (y) => {
166
169
  return isSingleBlockTypeActive(editor, y);
167
170
  });
168
171
 
169
172
  if (aliasFound) {
170
173
  isActive = true;
171
- defaultFormat = _.first(aliasList);
172
- matcher = (n) => _.includes(aliasList, n.type);
174
+ defaultFormat = first(aliasList);
175
+ matcher = (n) => includes(aliasList, n.type);
173
176
 
174
177
  return { isActive, defaultFormat, matcher };
175
178
  }
@@ -5,10 +5,10 @@ import {
5
5
  changeBlock,
6
6
  getBlocksFieldname,
7
7
  getBlocksLayoutFieldname,
8
- } from '@plone/volto/helpers';
8
+ } from '@plone/volto/helpers/Blocks/Blocks';
9
9
  import { Transforms, Editor, Node, Text, Path } from 'slate';
10
10
  import { serializeNodesToText } from '@plone/volto-slate/editor/render';
11
- import { omit } from 'lodash';
11
+ import omit from 'lodash/omit';
12
12
  import config from '@plone/volto/registry';
13
13
 
14
14
  function fromEntries(pairs) {
@@ -3,14 +3,14 @@
3
3
  */
4
4
 
5
5
  import React from 'react';
6
- import { debounce } from 'lodash';
6
+ import debounce from 'lodash/debounce';
7
7
  import ReactDOMServer from 'react-dom/server';
8
8
  import configureStore from 'redux-mock-store';
9
9
  import { MemoryRouter } from 'react-router-dom';
10
10
  import { Provider, useSelector } from 'react-redux';
11
11
  import { defineMessages, injectIntl } from 'react-intl';
12
12
 
13
- import { FormFieldWrapper } from '@plone/volto/components';
13
+ import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
14
14
  import SlateEditor from '@plone/volto-slate/editor/SlateEditor';
15
15
  import { serializeNodes } from '@plone/volto-slate/editor/render';
16
16
  import { makeEditor } from '@plone/volto-slate/utils';
@@ -17,12 +17,15 @@ import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
17
17
  import qs from 'query-string';
18
18
  import { useCookies } from 'react-cookie';
19
19
 
20
- import { Helmet } from '@plone/volto/helpers';
20
+ import Helmet from '@plone/volto/helpers/Helmet/Helmet';
21
21
  import config from '@plone/volto/registry';
22
- import { Icon } from '@plone/volto/components';
23
- import { login, resetLoginRequest } from '@plone/volto/actions';
22
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
23
+ import {
24
+ login,
25
+ resetLoginRequest,
26
+ } from '@plone/volto/actions/userSession/userSession';
24
27
  import { toast } from 'react-toastify';
25
- import { Toast } from '@plone/volto/components';
28
+ import Toast from '@plone/volto/components/manage/Toast/Toast';
26
29
  import aheadSVG from '@plone/volto/icons/ahead.svg';
27
30
  import clearSVG from '@plone/volto/icons/clear.svg';
28
31
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { isEqual } from 'lodash';
8
+ import isEqual from 'lodash/isEqual';
9
9
  import { compose } from 'redux';
10
10
  import { useDispatch, useSelector } from 'react-redux';
11
11
  import { defineMessages, injectIntl } from 'react-intl';
@@ -18,16 +18,13 @@ import {
18
18
  Icon,
19
19
  } from 'semantic-ui-react';
20
20
  import config from '@plone/volto/registry';
21
- import { getSchema } from '@plone/volto/actions';
21
+ import { getSchema } from '@plone/volto/actions/schema/schema';
22
22
  import { getWidget } from '@plone/volto/helpers/Widget/utils';
23
23
  import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
24
24
  import useClipboard from '@plone/volto/hooks/clipboard/useClipboard';
25
- import {
26
- hasBlocksData,
27
- getBaseUrl,
28
- addAppURL,
29
- Helmet,
30
- } from '@plone/volto/helpers';
25
+ import { hasBlocksData } from '@plone/volto/helpers/Blocks/Blocks';
26
+ import { getBaseUrl, addAppURL } from '@plone/volto/helpers/Url/Url';
27
+ import Helmet from '@plone/volto/helpers/Helmet/Helmet';
31
28
 
32
29
  const messages = defineMessages({
33
30
  rssFeed: {
@@ -1,7 +1,8 @@
1
1
  import express from 'express';
2
2
  import superagent from 'superagent';
3
3
  import RSS from 'rss';
4
- import { findBlocks, toPublicURL } from '@plone/volto/helpers';
4
+ import { findBlocks } from '@plone/volto/helpers/Blocks/Blocks';
5
+ import { toPublicURL } from '@plone/volto/helpers/Url/Url';
5
6
  import config from '@plone/volto/registry';
6
7
  import { addHeadersFactory } from '@plone/volto/helpers/Proxy/Proxy';
7
8
 
@@ -13,8 +13,8 @@ import {
13
13
  addAppURL,
14
14
  isInternalURL,
15
15
  flattenToAppURL,
16
- URLUtils,
17
- } from '@plone/volto/helpers';
16
+ } from '@plone/volto/helpers/Url/Url';
17
+ import { URLUtils } from '@plone/volto/helpers/Url/Url';
18
18
 
19
19
  import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib';
20
20
  import { Input, Form, Button } from 'semantic-ui-react';
@@ -27,7 +27,7 @@ import aheadSVG from '@plone/volto/icons/ahead.svg';
27
27
  import withObjectBrowser from '@plone/volto/components/manage/Sidebar/ObjectBrowser';
28
28
  import { withRouter } from 'react-router';
29
29
 
30
- import { Icon } from '@plone/volto/components';
30
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
31
31
 
32
32
  const messages = defineMessages({
33
33
  placeholder: {
@@ -1,5 +1,5 @@
1
1
  import { defineMessages } from 'react-intl';
2
- import { blocksFormGenerator } from '@plone/volto/helpers';
2
+ import { blocksFormGenerator } from '@plone/volto/helpers/Blocks/Blocks';
3
3
 
4
4
  import gridTemplate1 from './grid-1.svg';
5
5
  import gridTemplate2 from './grid-2.svg';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { getBaseUrl } from '@plone/volto/helpers';
2
+ import { getBaseUrl } from '@plone/volto/helpers/Url/Url';
3
3
  import { Breadcrumb } from 'semantic-ui-react';
4
4
  import { useSelector, useDispatch } from 'react-redux';
5
5
  import { Link, useLocation } from 'react-router-dom';
@@ -10,31 +10,29 @@ import PropTypes from 'prop-types';
10
10
  import { connect } from 'react-redux';
11
11
  import { compose } from 'redux';
12
12
  import { Link } from 'react-router-dom';
13
+ import { getParentUrl } from '@plone/volto/helpers/Url/Url';
13
14
  import {
14
- getParentUrl,
15
15
  hasBlocksData,
16
16
  getBlocksFieldname,
17
17
  getBlocksLayoutFieldname,
18
- } from '@plone/volto/helpers';
18
+ } from '@plone/volto/helpers/Blocks/Blocks';
19
19
  import { Portal } from 'react-portal';
20
20
  import { Button, Segment } from 'semantic-ui-react';
21
21
  import { toast } from 'react-toastify';
22
22
  import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
23
- import { nth, join } from 'lodash';
23
+ import nth from 'lodash/nth';
24
+ import join from 'lodash/join';
25
+ import Error from '@plone/volto/components/theme/Error/Error';
26
+ import Form from '@plone/volto/components/manage/Form/Form';
27
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
28
+ import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar';
29
+ import Sidebar from '@plone/volto/components/manage/Sidebar/Sidebar';
30
+ import Toast from '@plone/volto/components/manage/Toast/Toast';
31
+ import { getSchema, updateSchema } from '@plone/volto/actions/schema/schema';
24
32
  import {
25
- Error,
26
- Form,
27
- Icon,
28
- Toolbar,
29
- Sidebar,
30
- Toast,
31
- } from '@plone/volto/components';
32
- import {
33
- getSchema,
34
- updateSchema,
35
33
  getControlpanel,
36
34
  updateControlpanel,
37
- } from '@plone/volto/actions';
35
+ } from '@plone/volto/actions/controlpanels/controlpanels';
38
36
 
39
37
  import saveSVG from '@plone/volto/icons/save.svg';
40
38
  import clearSVG from '@plone/volto/icons/clear.svg';
@@ -4,9 +4,14 @@ import { connect } from 'react-redux';
4
4
  import { compose } from 'redux';
5
5
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
6
6
 
7
- import { getSchema, updateContent, getContent } from '@plone/volto/actions';
8
- import { getLayoutFieldname } from '@plone/volto/helpers';
9
- import { FormFieldWrapper, Icon } from '@plone/volto/components';
7
+ import { getSchema } from '@plone/volto/actions/schema/schema';
8
+ import {
9
+ updateContent,
10
+ getContent,
11
+ } from '@plone/volto/actions/content/content';
12
+ import { getLayoutFieldname } from '@plone/volto/helpers/Content/Content';
13
+ import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
14
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
10
15
  import { defineMessages, injectIntl } from 'react-intl';
11
16
  import config from '@plone/volto/registry';
12
17
 
@@ -95,8 +100,8 @@ const customSelectStyles = {
95
100
  color: state.isSelected
96
101
  ? '#007bc1'
97
102
  : state.isFocused
98
- ? '#4a4a4a'
99
- : 'inherit',
103
+ ? '#4a4a4a'
104
+ : 'inherit',
100
105
  ':active': {
101
106
  backgroundColor: null,
102
107
  },
@@ -4,20 +4,21 @@
4
4
  */
5
5
 
6
6
  import React, { useEffect, useState } from 'react';
7
- import { map } from 'lodash';
7
+ import map from 'lodash/map';
8
8
  import { defineMessages, useIntl } from 'react-intl';
9
9
  import { Form as UiForm, Menu, Segment } from 'semantic-ui-react';
10
10
  import { Provider } from 'react-intl-redux';
11
- import { Form, Field } from '@plone/volto/components';
11
+ import Form from '@plone/volto/components/manage/Form/Form';
12
+ import Field from '@plone/volto/components/manage/Form/Field';
12
13
  import config from '@plone/volto/registry';
13
14
  import configureStore from '@plone/volto/store';
15
+ import Api from '@plone/volto/helpers/Api/Api';
16
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
17
+ import langmap from '@plone/volto/helpers/LanguageMap/LanguageMap';
14
18
  import {
15
- Api,
16
- flattenToAppURL,
17
- langmap,
18
19
  toGettextLang,
19
20
  toReactIntlLang,
20
- } from '@plone/volto/helpers';
21
+ } from '@plone/volto/helpers/Utils/Utils';
21
22
  import { createBrowserHistory } from 'history';
22
23
  const messages = defineMessages({
23
24
  document: {
@@ -6,7 +6,10 @@
6
6
  import React, { Component } from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { compose } from 'redux';
9
- import { compact, isArray, isEmpty, remove } from 'lodash';
9
+ import compact from 'lodash/compact';
10
+ import isArray from 'lodash/isArray';
11
+ import isEmpty from 'lodash/isEmpty';
12
+ import remove from 'lodash/remove';
10
13
  import { connect } from 'react-redux';
11
14
  import { Label, Popup, Button } from 'semantic-ui-react';
12
15
  import {
@@ -2,25 +2,29 @@ import { useEffect, useState, useCallback } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { compose } from 'redux';
4
4
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
5
- import { uniqBy } from 'lodash';
5
+ import uniqBy from 'lodash/uniqBy';
6
6
  import { toast } from 'react-toastify';
7
7
  import { defineMessages, useIntl } from 'react-intl';
8
8
 
9
- import { FormFieldWrapper, Icon, Toast } from '@plone/volto/components';
9
+ import FormFieldWrapper from '@plone/volto/components/manage/Widgets/FormFieldWrapper';
10
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
11
+ import Toast from '@plone/volto/components/manage/Toast/Toast';
10
12
  import { Dimmer, Loader } from 'semantic-ui-react';
13
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
11
14
  import {
12
- flattenToAppURL,
13
15
  getWorkflowOptions,
14
16
  getCurrentStateMapping,
15
- } from '@plone/volto/helpers';
17
+ } from '@plone/volto/helpers/Workflows/Workflows';
16
18
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
17
19
 
18
20
  import {
19
21
  getContent,
22
+ linkIntegrityCheck,
23
+ } from '@plone/volto/actions/content/content';
24
+ import {
20
25
  getWorkflow,
21
26
  transitionWorkflow,
22
- linkIntegrityCheck,
23
- } from '@plone/volto/actions';
27
+ } from '@plone/volto/actions/workflow/workflow';
24
28
  import WorkflowLinkIntegrityModal from '@eeacms/volto-cca-policy/components/manage/Workflow/WorkflowLinkIntegrityModal';
25
29
  import downSVG from '@plone/volto/icons/down-key.svg';
26
30
  import upSVG from '@plone/volto/icons/up-key.svg';
@@ -152,8 +156,8 @@ const customSelectStyles = {
152
156
  color: state.isSelected
153
157
  ? '#007bc1'
154
158
  : state.isFocused
155
- ? '#4a4a4a'
156
- : 'inherit',
159
+ ? '#4a4a4a'
160
+ : 'inherit',
157
161
  ':active': {
158
162
  backgroundColor: null,
159
163
  },
@@ -8,7 +8,8 @@ import jwtDecode from 'jwt-decode';
8
8
  import PropTypes from 'prop-types';
9
9
  import { connect } from 'react-redux';
10
10
  import { compose } from 'redux';
11
- import { asyncConnect, Helmet } from '@plone/volto/helpers';
11
+ import { asyncConnect } from '@plone/volto/helpers/AsyncConnect';
12
+ import Helmet from '@plone/volto/helpers/Helmet/Helmet';
12
13
  import { Segment } from 'semantic-ui-react';
13
14
  import { renderRoutes } from 'react-router-config';
14
15
  import { Slide, ToastContainer, toast } from 'react-toastify';
@@ -23,28 +24,20 @@ import { injectIntl } from 'react-intl';
23
24
 
24
25
  import Error from '@plone/volto/error';
25
26
 
26
- import {
27
- Breadcrumbs,
28
- Footer,
29
- Header,
30
- Icon,
31
- OutdatedBrowser,
32
- AppExtras,
33
- SkipLinks,
34
- } from '@plone/volto/components';
35
- import {
36
- BodyClass,
37
- getBaseUrl,
38
- getView,
39
- hasApiExpander,
40
- isCmsUi,
41
- } from '@plone/volto/helpers';
42
- import {
43
- getBreadcrumbs,
44
- getContent,
45
- getNavigation,
46
- getTypes,
47
- } from '@plone/volto/actions';
27
+ import Breadcrumbs from '@plone/volto/components/theme/Breadcrumbs/Breadcrumbs';
28
+ import Footer from '@plone/volto/components/theme/Footer/Footer';
29
+ import Header from '@plone/volto/components/theme/Header/Header';
30
+ import Icon from '@plone/volto/components/theme/Icon/Icon';
31
+ import OutdatedBrowser from '@plone/volto/components/theme/OutdatedBrowser/OutdatedBrowser';
32
+ import AppExtras from '@plone/volto/components/theme/AppExtras/AppExtras';
33
+ import SkipLinks from '@plone/volto/components/theme/SkipLinks/SkipLinks';
34
+ import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
35
+ import { getBaseUrl, getView, isCmsUi } from '@plone/volto/helpers/Url/Url';
36
+ import { hasApiExpander } from '@plone/volto/helpers/Utils/Utils';
37
+ import { getBreadcrumbs } from '@plone/volto/actions/breadcrumbs/breadcrumbs';
38
+ import { getContent } from '@plone/volto/actions/content/content';
39
+ import { getNavigation } from '@plone/volto/actions/navigation/navigation';
40
+ import { getTypes } from '@plone/volto/actions/types/types';
48
41
 
49
42
  import clearSVG from '@plone/volto/icons/clear.svg';
50
43
  import MultilingualRedirector from '@plone/volto/components/theme/MultilingualRedirector/MultilingualRedirector';