@plone/volto 18.0.0-alpha.13 → 18.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/jest-setup-afterenv.js +2 -0
  3. package/locales/ca/LC_MESSAGES/volto.po +6 -0
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +6 -0
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +6 -0
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +6 -0
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +6 -0
  12. package/locales/eu.json +1 -1
  13. package/locales/fi/LC_MESSAGES/volto.po +6 -0
  14. package/locales/fi.json +1 -1
  15. package/locales/fr/LC_MESSAGES/volto.po +6 -0
  16. package/locales/fr.json +1 -1
  17. package/locales/it/LC_MESSAGES/volto.po +6 -0
  18. package/locales/it.json +1 -1
  19. package/locales/ja/LC_MESSAGES/volto.po +6 -0
  20. package/locales/ja.json +1 -1
  21. package/locales/nl/LC_MESSAGES/volto.po +6 -0
  22. package/locales/nl.json +1 -1
  23. package/locales/pt/LC_MESSAGES/volto.po +6 -0
  24. package/locales/pt.json +1 -1
  25. package/locales/pt_BR/LC_MESSAGES/volto.po +6 -0
  26. package/locales/pt_BR.json +1 -1
  27. package/locales/ro/LC_MESSAGES/volto.po +6 -0
  28. package/locales/ro.json +1 -1
  29. package/locales/volto.pot +7 -1
  30. package/locales/zh_CN/LC_MESSAGES/volto.po +6 -0
  31. package/locales/zh_CN.json +1 -1
  32. package/package.json +28 -23
  33. package/src/components/manage/Add/Add.jsx +9 -11
  34. package/src/components/manage/Add/Add.test.jsx +11 -13
  35. package/src/components/manage/Aliases/Aliases.jsx +6 -6
  36. package/src/components/manage/Aliases/Aliases.test.jsx +7 -7
  37. package/src/components/manage/BlockChooser/BlockChooser.test.jsx +0 -1
  38. package/src/components/manage/BlockChooser/BlockChooserButton.jsx +6 -6
  39. package/src/components/manage/BlockChooser/BlockChooserSearch.test.jsx +0 -1
  40. package/src/components/manage/Blocks/Block/Settings.test.jsx +0 -1
  41. package/src/components/manage/Blocks/Container/NewBlockAddButton.jsx +20 -19
  42. package/src/components/manage/Blocks/Image/View.test.jsx +0 -1
  43. package/src/components/manage/Blocks/Table/Edit.jsx +7 -6
  44. package/src/components/manage/Contents/Contents.jsx +6 -6
  45. package/src/components/manage/Contents/Contents.test.jsx +7 -7
  46. package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +4 -4
  47. package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +6 -6
  48. package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +6 -7
  49. package/src/components/manage/Controlpanels/Aliases.jsx +6 -6
  50. package/src/components/manage/Controlpanels/Aliases.test.jsx +6 -7
  51. package/src/components/manage/Controlpanels/ContentType.jsx +6 -6
  52. package/src/components/manage/Controlpanels/ContentType.test.jsx +7 -7
  53. package/src/components/manage/Controlpanels/ContentTypeLayout.jsx +93 -85
  54. package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +7 -7
  55. package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +6 -6
  56. package/src/components/manage/Controlpanels/ContentTypes.jsx +6 -6
  57. package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -7
  58. package/src/components/manage/Controlpanels/Controlpanel.jsx +6 -6
  59. package/src/components/manage/Controlpanels/Controlpanel.test.jsx +7 -7
  60. package/src/components/manage/Controlpanels/Controlpanels.jsx +6 -6
  61. package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -10
  62. package/src/components/manage/Controlpanels/DatabaseInformation.jsx +6 -6
  63. package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +6 -6
  64. package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -7
  65. package/src/components/manage/Controlpanels/ModerateComments.jsx +6 -6
  66. package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -7
  67. package/src/components/manage/Controlpanels/Relations/Relations.jsx +13 -7
  68. package/src/components/manage/Controlpanels/Rules/AddRule.jsx +6 -6
  69. package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +6 -7
  70. package/src/components/manage/Controlpanels/Rules/ConfigureRule.jsx +6 -6
  71. package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +6 -7
  72. package/src/components/manage/Controlpanels/Rules/EditRule.jsx +6 -6
  73. package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +6 -7
  74. package/src/components/manage/Controlpanels/Rules/Rules.jsx +6 -6
  75. package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +6 -7
  76. package/src/components/manage/Controlpanels/Rules/components/{VariableModal.test.jsx → VariableModal.test.jsx.removed} +6 -7
  77. package/src/components/manage/Controlpanels/UndoControlpanel.jsx +6 -6
  78. package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +7 -7
  79. package/src/components/manage/Controlpanels/UpgradeControlPanel.jsx +6 -6
  80. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +14 -8
  81. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +7 -7
  82. package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +6 -6
  83. package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +7 -7
  84. package/src/components/manage/Delete/Delete.jsx +6 -6
  85. package/src/components/manage/Delete/Delete.test.jsx +10 -10
  86. package/src/components/manage/Diff/Diff.jsx +6 -6
  87. package/src/components/manage/Diff/Diff.test.jsx +2 -3
  88. package/src/components/manage/Edit/Edit.jsx +10 -11
  89. package/src/components/manage/Edit/Edit.test.jsx +14 -10
  90. package/src/components/manage/Form/BlockDataForm.test.jsx +0 -1
  91. package/src/components/manage/Form/Form.jsx +148 -122
  92. package/src/components/manage/Form/Form.test.jsx +7 -0
  93. package/src/components/manage/Form/ModalForm.test.jsx +0 -1
  94. package/src/components/manage/History/History.jsx +6 -6
  95. package/src/components/manage/History/History.test.jsx +14 -13
  96. package/src/components/manage/LinksToItem/LinksToItem.jsx +78 -49
  97. package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -7
  98. package/src/components/manage/Multilingual/ManageTranslations.jsx +13 -7
  99. package/src/components/manage/Multilingual/ManageTranslations.test.jsx +6 -7
  100. package/src/components/manage/Preferences/ChangePassword.jsx +6 -6
  101. package/src/components/manage/Preferences/ChangePassword.test.jsx +13 -7
  102. package/src/components/manage/Preferences/PersonalInformation.test.jsx +15 -3
  103. package/src/components/manage/Preferences/PersonalPreferences.test.jsx +8 -3
  104. package/src/components/manage/Rules/Rules.jsx +6 -6
  105. package/src/components/manage/Rules/Rules.test.jsx +7 -7
  106. package/src/components/manage/Sharing/Sharing.jsx +6 -6
  107. package/src/components/manage/Sharing/Sharing.test.jsx +7 -7
  108. package/src/components/manage/Sidebar/ObjectBrowser.jsx +1 -1
  109. package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
  110. package/src/components/manage/Sidebar/SidebarPopup.jsx +28 -21
  111. package/src/components/manage/Sidebar/SidebarPortal.jsx +7 -6
  112. package/src/components/manage/Toolbar/Toolbar.jsx +35 -2
  113. package/src/components/manage/Widgets/ArrayWidget.jsx +3 -1
  114. package/src/components/manage/Widgets/FileWidget.jsx +1 -1
  115. package/src/components/manage/Widgets/ObjectBrowserWidget.test.jsx +4 -4
  116. package/src/components/manage/Widgets/ObjectListWidget.test.js +0 -1
  117. package/src/components/manage/Widgets/ObjectWidget.test.jsx +0 -1
  118. package/src/components/manage/Widgets/SchemaWidget.test.jsx +4 -4
  119. package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +5 -5
  120. package/src/components/manage/Widgets/UrlWidget.test.jsx +4 -4
  121. package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +4 -4
  122. package/src/components/theme/Comments/Comments.jsx +7 -8
  123. package/src/components/theme/Comments/Comments.test.jsx +7 -0
  124. package/src/components/theme/Component/Component.test.jsx +0 -1
  125. package/src/components/theme/ContactForm/ContactForm.jsx +6 -6
  126. package/src/components/theme/ContactForm/ContactForm.test.jsx +12 -10
  127. package/src/components/theme/Footer/Footer.test.jsx +0 -1
  128. package/src/components/theme/Logo/Logo.Multilingual.test.jsx +3 -1
  129. package/src/components/theme/Logo/Logo.jsx +18 -12
  130. package/src/components/theme/Logo/Logo.test.jsx +4 -1
  131. package/src/components/theme/Logout/Logout.test.jsx +8 -5
  132. package/src/components/theme/PasswordReset/PasswordReset.test.jsx +7 -0
  133. package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +7 -0
  134. package/src/components/theme/Register/Register.test.jsx +7 -0
  135. package/src/components/theme/Search/Search.jsx +6 -6
  136. package/src/components/theme/Search/Search.test.jsx +13 -10
  137. package/src/components/theme/SlotRenderer/SlotRenderer.test.jsx +55 -0
  138. package/src/components/theme/SlotRenderer/SlotRenderer.tsx +54 -0
  139. package/src/components/theme/View/View.jsx +9 -6
  140. package/src/components/theme/View/View.test.jsx +28 -18
  141. package/src/config/index.js +3 -1
  142. package/src/helpers/AsyncConnect/AsyncConnect.test.js +0 -2
  143. package/src/helpers/Blocks/Blocks.js +5 -2
  144. package/src/helpers/Slots/index.tsx +12 -0
  145. package/src/helpers/Utils/UseDetectClickOutside.stories.jsx +8 -8
  146. package/src/helpers/index.js +1 -0
  147. package/src/start-client.jsx +3 -3
  148. package/test-setup-config.js +1 -0
  149. package/theme/themes/pastanaga/extras/toolbar.less +4 -4
  150. package/tsconfig.declarations.json +1 -0
  151. package/types/components/manage/Actions/Actions.d.ts +1 -1
  152. package/types/components/manage/Add/Add.d.ts +1 -4
  153. package/types/components/manage/Aliases/Aliases.d.ts +1 -4
  154. package/types/components/manage/AnchorPlugin/components/Link/index.d.ts +1 -1
  155. package/types/components/manage/BlockChooser/BlockChooserButton.d.ts +2 -2
  156. package/types/components/manage/BlockChooser/BlockChooserSearch.d.ts +1 -1
  157. package/types/components/manage/Blocks/Block/BlocksForm.d.ts +1 -1
  158. package/types/components/manage/Blocks/Block/DefaultEdit.d.ts +1 -1
  159. package/types/components/manage/Blocks/Block/DefaultView.d.ts +1 -1
  160. package/types/components/manage/Blocks/Block/Edit.d.ts +1 -3
  161. package/types/components/manage/Blocks/Block/Style.d.ts +1 -1
  162. package/types/components/manage/Blocks/Container/Data.d.ts +1 -1
  163. package/types/components/manage/Blocks/Container/Edit.d.ts +1 -1
  164. package/types/components/manage/Blocks/Container/EditBlockWrapper.d.ts +1 -1
  165. package/types/components/manage/Blocks/Container/NewBlockAddButton.d.ts +1 -1
  166. package/types/components/manage/Blocks/Container/SimpleContainerToolbar.d.ts +1 -1
  167. package/types/components/manage/Blocks/Description/Edit.d.ts +1 -1
  168. package/types/components/manage/Blocks/Description/View.d.ts +1 -1
  169. package/types/components/manage/Blocks/Grid/Edit.d.ts +1 -1
  170. package/types/components/manage/Blocks/Grid/View.d.ts +1 -1
  171. package/types/components/manage/Blocks/HTML/View.d.ts +1 -1
  172. package/types/components/manage/Blocks/HeroImageLeft/Data.d.ts +1 -1
  173. package/types/components/manage/Blocks/HeroImageLeft/Edit.d.ts +1 -4
  174. package/types/components/manage/Blocks/HeroImageLeft/View.d.ts +1 -1
  175. package/types/components/manage/Blocks/Image/Edit.d.ts +1 -4
  176. package/types/components/manage/Blocks/Image/ImageSidebar.d.ts +1 -1
  177. package/types/components/manage/Blocks/Image/View.d.ts +2 -2
  178. package/types/components/manage/Blocks/Image/schema.d.ts +1 -1
  179. package/types/components/manage/Blocks/LeadImage/View.d.ts +1 -1
  180. package/types/components/manage/Blocks/Listing/DefaultNoResultsComponent.d.ts +1 -1
  181. package/types/components/manage/Blocks/Listing/DefaultTemplate.d.ts +1 -1
  182. package/types/components/manage/Blocks/Listing/Edit.d.ts +1 -1
  183. package/types/components/manage/Blocks/Listing/GalleryNoResultsComponent.d.ts +1 -1
  184. package/types/components/manage/Blocks/Listing/ImageGallery.d.ts +1 -1
  185. package/types/components/manage/Blocks/Listing/ListingData.d.ts +1 -1
  186. package/types/components/manage/Blocks/Listing/SummaryTemplate.d.ts +1 -1
  187. package/types/components/manage/Blocks/Listing/View.d.ts +1 -1
  188. package/types/components/manage/Blocks/Maps/Edit.d.ts +1 -1
  189. package/types/components/manage/Blocks/Maps/MapsSidebar.d.ts +1 -1
  190. package/types/components/manage/Blocks/Search/SearchBlockEdit.d.ts +1 -1
  191. package/types/components/manage/Blocks/Search/SearchBlockView.d.ts +2 -2
  192. package/types/components/manage/Blocks/Search/components/CheckboxFacet.d.ts +1 -1
  193. package/types/components/manage/Blocks/Search/components/DateRangeFacetFilterListEntry.d.ts +1 -1
  194. package/types/components/manage/Blocks/Search/components/Facets.d.ts +1 -1
  195. package/types/components/manage/Blocks/Search/components/FilterList.d.ts +1 -1
  196. package/types/components/manage/Blocks/Search/components/SearchDetails.d.ts +1 -1
  197. package/types/components/manage/Blocks/Search/components/SearchInput.d.ts +1 -1
  198. package/types/components/manage/Blocks/Search/components/SelectFacetFilterListEntry.d.ts +1 -1
  199. package/types/components/manage/Blocks/Search/components/ToggleFacet.d.ts +1 -1
  200. package/types/components/manage/Blocks/Search/components/ToggleFacetFilterListEntry.d.ts +1 -1
  201. package/types/components/manage/Blocks/Search/hocs/withQueryString.d.ts +1 -1
  202. package/types/components/manage/Blocks/Search/hocs/withSearch.d.ts +1 -1
  203. package/types/components/manage/Blocks/Search/layout/LeftColumnFacets.d.ts +1 -1
  204. package/types/components/manage/Blocks/Search/layout/RightColumnFacets.d.ts +1 -1
  205. package/types/components/manage/Blocks/Search/layout/TopSideFacets.d.ts +1 -1
  206. package/types/components/manage/Blocks/Search/utils.d.ts +2 -2
  207. package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +1 -1
  208. package/types/components/manage/Blocks/Table/Cell.d.ts +1 -1
  209. package/types/components/manage/Blocks/Table/View.d.ts +1 -1
  210. package/types/components/manage/Blocks/Teaser/Body.d.ts +1 -1
  211. package/types/components/manage/Blocks/Teaser/Data.d.ts +1 -1
  212. package/types/components/manage/Blocks/Teaser/DefaultBody.d.ts +1 -1
  213. package/types/components/manage/Blocks/Teaser/Edit.d.ts +1 -1
  214. package/types/components/manage/Blocks/Teaser/View.d.ts +1 -1
  215. package/types/components/manage/Blocks/Text/Edit.d.ts +1 -1
  216. package/types/components/manage/Blocks/Title/Edit.d.ts +1 -1
  217. package/types/components/manage/Blocks/Title/View.d.ts +1 -1
  218. package/types/components/manage/Blocks/ToC/Edit.d.ts +1 -1
  219. package/types/components/manage/Blocks/Video/Body.d.ts +1 -1
  220. package/types/components/manage/Blocks/Video/VideoSidebar.d.ts +1 -1
  221. package/types/components/manage/Blocks/Video/View.d.ts +1 -1
  222. package/types/components/manage/Contents/Contents.d.ts +2 -7
  223. package/types/components/manage/Contents/ContentsBreadcrumbs.d.ts +1 -1
  224. package/types/components/manage/Contents/ContentsBreadcrumbsHomeItem.d.ts +1 -1
  225. package/types/components/manage/Contents/ContentsBreadcrumbsRootItem.d.ts +1 -1
  226. package/types/components/manage/Contents/ContentsPropertiesModal.d.ts +1 -1
  227. package/types/components/manage/Contents/ContentsRenameModal.d.ts +1 -1
  228. package/types/components/manage/Contents/ContentsRenameModal.stories.d.ts +1 -1
  229. package/types/components/manage/Contents/ContentsTagsModal.d.ts +1 -1
  230. package/types/components/manage/Contents/ContentsTagsModal.stories.d.ts +1 -1
  231. package/types/components/manage/Contents/ContentsUploadModal.d.ts +1 -4
  232. package/types/components/manage/Contents/ContentsWorkflowModal.d.ts +1 -1
  233. package/types/components/manage/Contents/circle.d.ts +1 -1
  234. package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +1 -4
  235. package/types/components/manage/Controlpanels/Aliases.d.ts +1 -4
  236. package/types/components/manage/Controlpanels/ContentType.d.ts +1 -4
  237. package/types/components/manage/Controlpanels/ContentTypeLayout.d.ts +1 -4
  238. package/types/components/manage/Controlpanels/ContentTypeSchema.d.ts +1 -4
  239. package/types/components/manage/Controlpanels/ContentTypes.d.ts +1 -4
  240. package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +1 -4
  241. package/types/components/manage/Controlpanels/Groups/GroupsControlpanel.d.ts +1 -4
  242. package/types/components/manage/Controlpanels/ModerateComments.d.ts +1 -4
  243. package/types/components/manage/Controlpanels/Relations/BrokenRelations.d.ts +1 -1
  244. package/types/components/manage/Controlpanels/Relations/Relations.d.ts +1 -1
  245. package/types/components/manage/Controlpanels/Relations/RelationsListing.d.ts +1 -1
  246. package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +3 -5
  247. package/types/components/manage/Controlpanels/Rules/AddRule.d.ts +1 -4
  248. package/types/components/manage/Controlpanels/Rules/ConfigureRule.d.ts +1 -4
  249. package/types/components/manage/Controlpanels/Rules/EditRule.d.ts +1 -4
  250. package/types/components/manage/Controlpanels/Rules/Rules.d.ts +1 -4
  251. package/types/components/manage/Controlpanels/Rules/components/VariableModal.d.ts +1 -4
  252. package/types/components/manage/Controlpanels/UndoControlpanel.d.ts +1 -4
  253. package/types/components/manage/Controlpanels/UpgradeControlPanel.d.ts +1 -4
  254. package/types/components/manage/Controlpanels/Users/RenderUsers.d.ts +1 -4
  255. package/types/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.d.ts +1 -1
  256. package/types/components/manage/Controlpanels/Users/UserGroupMembershipListing.d.ts +1 -1
  257. package/types/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.d.ts +1 -1
  258. package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +1 -4
  259. package/types/components/manage/Controlpanels/VersionOverview.d.ts +1 -1
  260. package/types/components/manage/Delete/Delete.d.ts +1 -1
  261. package/types/components/manage/Display/Display.d.ts +1 -4
  262. package/types/components/manage/Edit/Edit.d.ts +2 -7
  263. package/types/components/manage/Form/BlockDataForm.d.ts +1 -1
  264. package/types/components/manage/Form/BlocksToolbar.d.ts +2 -4
  265. package/types/components/manage/Form/UndoToolbar.d.ts +1 -1
  266. package/types/components/manage/History/History.d.ts +1 -4
  267. package/types/components/manage/LinkDetectionPlugin/link-detection-plugin.d.ts +1 -1
  268. package/types/components/manage/LinkMore/LinkMore.d.ts +1 -1
  269. package/types/components/manage/LinksToItem/LinksToItem.d.ts +1 -1
  270. package/types/components/manage/Messages/Messages.d.ts +1 -1
  271. package/types/components/manage/Multilingual/CreateTranslation.d.ts +1 -1
  272. package/types/components/manage/Multilingual/ManageTranslations.d.ts +3 -5
  273. package/types/components/manage/Multilingual/TranslationObject.d.ts +1 -1
  274. package/types/components/manage/Pluggable/Pluggable.stories.d.ts +4 -4
  275. package/types/components/manage/Pluggable/index.d.ts +21 -3
  276. package/types/components/manage/Preferences/PersonalPreferences.d.ts +1 -4
  277. package/types/components/manage/Rules/Rules.d.ts +1 -4
  278. package/types/components/manage/Sidebar/AlignBlock.d.ts +1 -1
  279. package/types/components/manage/Sidebar/ObjectBrowser.d.ts +3 -5
  280. package/types/components/manage/Sidebar/ObjectBrowserBody.d.ts +1 -4
  281. package/types/components/manage/Sidebar/ObjectBrowserNav.d.ts +1 -1
  282. package/types/components/manage/Sidebar/SidebarPopup.d.ts +1 -1
  283. package/types/components/manage/Sidebar/SidebarPortal.d.ts +2 -1
  284. package/types/components/manage/TemplateChooser/TemplateChooser.d.ts +1 -1
  285. package/types/components/manage/TextLineEdit/TextLineEdit.d.ts +1 -1
  286. package/types/components/manage/TextLineEdit/TextLineEdit.stories.d.ts +1 -1
  287. package/types/components/manage/Toast/Toast.d.ts +1 -1
  288. package/types/components/manage/Toolbar/PersonalTools.d.ts +1 -1
  289. package/types/components/manage/Toolbar/StandardWrapper.d.ts +1 -1
  290. package/types/components/manage/Toolbar/Stats.d.ts +1 -1
  291. package/types/components/manage/Toolbar/Toolbar.d.ts +1 -4
  292. package/types/components/manage/UniversalLink/UniversalLink.d.ts +1 -1
  293. package/types/components/manage/Widgets/AlignWidget.d.ts +1 -1
  294. package/types/components/manage/Widgets/AlignWidget.stories.d.ts +1 -1
  295. package/types/components/manage/Widgets/ArrayWidget.d.ts +1 -3
  296. package/types/components/manage/Widgets/ArrayWidget.stories.d.ts +1 -1
  297. package/types/components/manage/Widgets/ButtonsWidget.d.ts +1 -1
  298. package/types/components/manage/Widgets/ButtonsWidget.stories.d.ts +1 -1
  299. package/types/components/manage/Widgets/CheckboxWidget.stories.d.ts +1 -1
  300. package/types/components/manage/Widgets/ColorPickerWidget.d.ts +1 -2
  301. package/types/components/manage/Widgets/DatetimeWidget.d.ts +1 -1
  302. package/types/components/manage/Widgets/DatetimeWidget.stories.d.ts +1 -1
  303. package/types/components/manage/Widgets/EmailWidget.d.ts +1 -1
  304. package/types/components/manage/Widgets/EmailWidget.stories.d.ts +1 -1
  305. package/types/components/manage/Widgets/FileWidget.stories.d.ts +1 -1
  306. package/types/components/manage/Widgets/FormFieldWrapper.stories.d.ts +1 -1
  307. package/types/components/manage/Widgets/IdWidget.d.ts +1 -4
  308. package/types/components/manage/Widgets/IdWidget.stories.d.ts +1 -1
  309. package/types/components/manage/Widgets/ImageSizeWidget.stories.d.ts +1 -1
  310. package/types/components/manage/Widgets/InternalUrlWidget.d.ts +4 -6
  311. package/types/components/manage/Widgets/InternalUrlWidget.stories.d.ts +1 -1
  312. package/types/components/manage/Widgets/NumberWidget.stories.d.ts +1 -1
  313. package/types/components/manage/Widgets/ObjectBrowserWidget.d.ts +1 -1
  314. package/types/components/manage/Widgets/ObjectBrowserWidget.stories.d.ts +7 -7
  315. package/types/components/manage/Widgets/ObjectListWidget.d.ts +1 -1
  316. package/types/components/manage/Widgets/ObjectListWidget.stories.d.ts +2 -2
  317. package/types/components/manage/Widgets/ObjectWidget.d.ts +1 -1
  318. package/types/components/manage/Widgets/ObjectWidget.stories.d.ts +1 -1
  319. package/types/components/manage/Widgets/PasswordWidget.stories.d.ts +1 -1
  320. package/types/components/manage/Widgets/QueryWidget.d.ts +1 -3
  321. package/types/components/manage/Widgets/QueryWidget.stories.d.ts +1 -1
  322. package/types/components/manage/Widgets/QuerystringWidget.d.ts +1 -1
  323. package/types/components/manage/Widgets/RecurrenceWidget/ByMonthDayField.d.ts +16 -2
  324. package/types/components/manage/Widgets/RecurrenceWidget/ByMonthField.d.ts +20 -2
  325. package/types/components/manage/Widgets/RecurrenceWidget/ByYearField.d.ts +22 -2
  326. package/types/components/manage/Widgets/RecurrenceWidget/EndField.d.ts +16 -2
  327. package/types/components/manage/Widgets/ReferenceWidget.d.ts +1 -4
  328. package/types/components/manage/Widgets/SchemaWidget.d.ts +1 -4
  329. package/types/components/manage/Widgets/SelectAutoComplete.d.ts +1 -3
  330. package/types/components/manage/Widgets/SelectAutocompleteWidget.stories.d.ts +1 -1
  331. package/types/components/manage/Widgets/SelectStyling.d.ts +1 -1
  332. package/types/components/manage/Widgets/SelectWidget.stories.d.ts +1 -1
  333. package/types/components/manage/Widgets/TextWidget.stories.d.ts +1 -1
  334. package/types/components/manage/Widgets/TextareaWidget.stories.d.ts +1 -1
  335. package/types/components/manage/Widgets/TokenWidget.d.ts +1 -4
  336. package/types/components/manage/Widgets/TokenWidget.stories.d.ts +1 -1
  337. package/types/components/manage/Widgets/UrlWidget.d.ts +4 -6
  338. package/types/components/manage/Widgets/UrlWidget.stories.d.ts +1 -1
  339. package/types/components/manage/Widgets/VocabularyTermsWidget.d.ts +1 -1
  340. package/types/components/manage/Widgets/VocabularyTermsWidget.stories.d.ts +1 -1
  341. package/types/components/manage/Widgets/WysiwygWidget.d.ts +2 -5
  342. package/types/components/manage/Widgets/WysiwygWidget.stories.d.ts +1 -1
  343. package/types/components/manage/Widgets/story.d.ts +1 -1
  344. package/types/components/theme/Anontools/Anontools.d.ts +1 -1
  345. package/types/components/theme/AppExtras/AppExtras.d.ts +1 -1
  346. package/types/components/theme/Avatar/Avatar.d.ts +1 -1
  347. package/types/components/theme/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  348. package/types/components/theme/Comments/Comment.stories.d.ts +1 -1
  349. package/types/components/theme/Comments/CommentEditModal.d.ts +1 -1
  350. package/types/components/theme/Comments/CommentEditModal.stories.d.ts +1 -1
  351. package/types/components/theme/Component/Component.d.ts +1 -1
  352. package/types/components/theme/ConnectionRefused/ConnectionRefused.d.ts +1 -1
  353. package/types/components/theme/ContactForm/ContactForm.d.ts +1 -1
  354. package/types/components/theme/ContactForm/ContactForm.stories.d.ts +1 -1
  355. package/types/components/theme/ContentMetadataTags/ContentMetadataTags.d.ts +1 -1
  356. package/types/components/theme/Error/ErrorBoundary.d.ts +1 -0
  357. package/types/components/theme/Error/ServerError.d.ts +1 -1
  358. package/types/components/theme/EventDetails/EventDetails.d.ts +1 -1
  359. package/types/components/theme/EventDetails/EventDetails.stories.d.ts +1 -1
  360. package/types/components/theme/Forbidden/Forbidden.d.ts +1 -1
  361. package/types/components/theme/FormattedDate/FormattedDate.d.ts +1 -1
  362. package/types/components/theme/FormattedDate/FormattedDate.stories.d.ts +1 -1
  363. package/types/components/theme/FormattedDate/FormattedRelativeDate.d.ts +1 -1
  364. package/types/components/theme/FormattedDate/FormattedRelativeDate.stories.d.ts +1 -1
  365. package/types/components/theme/Header/Header.d.ts +1 -1
  366. package/types/components/theme/Header/Header.stories.d.ts +1 -1
  367. package/types/components/theme/Image/Image.d.ts +1 -1
  368. package/types/components/theme/LanguageSelector/LanguageSelector.d.ts +1 -1
  369. package/types/components/theme/Login/Login.d.ts +1 -1
  370. package/types/components/theme/Login/Login.stories.d.ts +1 -1
  371. package/types/components/theme/Logo/Logo.stories.d.ts +1 -1
  372. package/types/components/theme/Logout/Logout.d.ts +1 -1
  373. package/types/components/theme/MultilingualRedirector/MultilingualRedirector.d.ts +1 -1
  374. package/types/components/theme/Navigation/ContextNavigation.d.ts +1 -1
  375. package/types/components/theme/Navigation/ContextNavigation.stories.d.ts +2 -2
  376. package/types/components/theme/Navigation/NavItem.d.ts +1 -1
  377. package/types/components/theme/Navigation/NavItems.d.ts +1 -1
  378. package/types/components/theme/Navigation/Navigation.d.ts +1 -1
  379. package/types/components/theme/Navigation/withContentNavigation.d.ts +1 -1
  380. package/types/components/theme/NotFound/NotFound.d.ts +1 -1
  381. package/types/components/theme/OutdatedBrowser/OutdatedBrowser.d.ts +1 -1
  382. package/types/components/theme/PasswordReset/RequestPasswordReset.d.ts +1 -1
  383. package/types/components/theme/Popup/Popup.d.ts +1 -1
  384. package/types/components/theme/PreviewImage/PreviewImage.d.ts +1 -1
  385. package/types/components/theme/Search/Search.d.ts +2 -7
  386. package/types/components/theme/Search/SearchTags.d.ts +1 -1
  387. package/types/components/theme/SearchWidget/SearchWidget.d.ts +1 -1
  388. package/types/components/theme/SearchWidget/SearchWidget.stories.d.ts +1 -1
  389. package/types/components/theme/Sitemap/Sitemap.d.ts +2 -6
  390. package/types/components/theme/SkipLinks/SkipLinks.d.ts +1 -1
  391. package/types/components/theme/SlotRenderer/SlotRenderer.d.ts +7 -0
  392. package/types/components/theme/SlotRenderer/SlotRenderer.test.d.ts +1 -0
  393. package/types/components/theme/TsTest/TsTest.d.ts +1 -2
  394. package/types/components/theme/Unauthorized/Unauthorized.d.ts +1 -1
  395. package/types/components/theme/View/AlbumView.d.ts +1 -1
  396. package/types/components/theme/View/EventDatesInfo.d.ts +1 -1
  397. package/types/components/theme/View/LinkView.d.ts +1 -1
  398. package/types/components/theme/View/RenderBlocks.d.ts +1 -1
  399. package/types/components/theme/View/View.d.ts +1 -4
  400. package/types/components/theme/Widgets/ArrayWidget.d.ts +1 -1
  401. package/types/components/theme/Widgets/BooleanWidget.d.ts +14 -2
  402. package/types/components/theme/Widgets/DateWidget.d.ts +1 -1
  403. package/types/components/theme/Widgets/DatetimeWidget.d.ts +1 -1
  404. package/types/components/theme/Widgets/DescriptionWidget.d.ts +1 -1
  405. package/types/components/theme/Widgets/EmailWidget.d.ts +1 -1
  406. package/types/components/theme/Widgets/FileWidget.d.ts +1 -1
  407. package/types/components/theme/Widgets/ImageWidget.d.ts +1 -1
  408. package/types/components/theme/Widgets/PasswordWidget.d.ts +1 -1
  409. package/types/components/theme/Widgets/RelationWidget.d.ts +1 -1
  410. package/types/components/theme/Widgets/RelationsWidget.d.ts +1 -1
  411. package/types/components/theme/Widgets/RichTextWidget.d.ts +1 -1
  412. package/types/components/theme/Widgets/SelectWidget.d.ts +1 -1
  413. package/types/components/theme/Widgets/TextWidget.d.ts +1 -1
  414. package/types/components/theme/Widgets/TitleWidget.d.ts +1 -1
  415. package/types/components/theme/Widgets/TokenWidget.d.ts +1 -1
  416. package/types/components/theme/Widgets/UrlWidget.d.ts +1 -1
  417. package/types/config/Blocks.d.ts +1 -1
  418. package/types/config/RichTextEditor/ToHTML.d.ts +10 -10
  419. package/types/config/Views.d.ts +5 -5
  420. package/types/config/Widgets.d.ts +1 -3
  421. package/types/helpers/AsyncConnect/AsyncConnect.d.ts +2 -2
  422. package/types/helpers/Extensions/withBlockExtensions.d.ts +1 -1
  423. package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +3 -3
  424. package/types/helpers/Helmet/Helmet.d.ts +6 -10
  425. package/types/helpers/LanguageMap/LanguageMap.d.ts +878 -1
  426. package/types/helpers/Slots/index.d.ts +7 -0
  427. package/types/helpers/Utils/Date.d.ts +2 -2
  428. package/types/helpers/Utils/UseDetectClickOutside.stories.d.ts +2 -2
  429. package/types/helpers/Utils/Utils.d.ts +1 -1
  430. package/types/helpers/index.d.ts +1 -0
  431. package/types/reducers/blocksClipboard/blocksClipboard.d.ts +1 -1
  432. package/types/routes.d.ts +3 -3
  433. package/types/storybook.d.ts +3 -3
  434. package/src/components/manage/Multilingual/CreateTranslation.test.jsx +0 -46
  435. package/src/helpers/Utils/usePagination.test.js +0 -115
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import renderer from 'react-test-renderer';
2
+ import { render } from '@testing-library/react';
3
3
  import configureStore from 'redux-mock-store';
4
4
  import { Provider } from 'react-redux';
5
5
  import { IntlProvider } from 'react-intl';
6
+ import { MemoryRouter } from 'react-router-dom';
6
7
 
7
8
  import Logout from './Logout';
8
9
 
@@ -21,14 +22,16 @@ describe('Logout', () => {
21
22
  messages: {},
22
23
  },
23
24
  });
24
- const component = renderer.create(
25
+ const { container } = render(
25
26
  <Provider store={store}>
26
27
  <IntlProvider locale="en">
27
- <Logout location={{ pathname: '' }} />
28
+ <MemoryRouter>
29
+ <Logout location={{ pathname: '' }} />
30
+ </MemoryRouter>
28
31
  </IntlProvider>
29
32
  </Provider>,
30
33
  );
31
- const json = component.toJSON();
32
- expect(json).toMatchSnapshot();
34
+
35
+ expect(container).toMatchSnapshot();
33
36
  });
34
37
  });
@@ -22,6 +22,13 @@ describe('PasswordReset', () => {
22
22
  locale: 'en',
23
23
  messages: {},
24
24
  },
25
+ content: {
26
+ data: {},
27
+ create: {
28
+ loading: false,
29
+ loaded: true,
30
+ },
31
+ },
25
32
  });
26
33
  const component = renderer.create(
27
34
  <Provider store={store}>
@@ -22,6 +22,13 @@ describe('RequestPasswordReset', () => {
22
22
  locale: 'en',
23
23
  messages: {},
24
24
  },
25
+ content: {
26
+ data: {},
27
+ create: {
28
+ loading: false,
29
+ loaded: true,
30
+ },
31
+ },
25
32
  });
26
33
  const component = renderer.create(
27
34
  <Provider store={store}>
@@ -22,6 +22,13 @@ describe('Register', () => {
22
22
  locale: 'en',
23
23
  messages: {},
24
24
  },
25
+ content: {
26
+ data: {},
27
+ create: {
28
+ loading: false,
29
+ loaded: true,
30
+ },
31
+ },
25
32
  });
26
33
  const component = renderer.create(
27
34
  <Provider store={store}>
@@ -10,7 +10,7 @@ import { compose } from 'redux';
10
10
  import { UniversalLink } from '@plone/volto/components';
11
11
  import { asyncConnect } from '@plone/volto/helpers';
12
12
  import { FormattedMessage } from 'react-intl';
13
- import { Portal } from 'react-portal';
13
+ import { createPortal } from 'react-dom';
14
14
  import { Container, Pagination, Button, Header } from 'semantic-ui-react';
15
15
  import qs from 'query-string';
16
16
  import classNames from 'classnames';
@@ -309,15 +309,15 @@ class Search extends Component {
309
309
  </section>
310
310
  </article>
311
311
  </div>
312
- {this.state.isClient && (
313
- <Portal node={document.getElementById('toolbar')}>
312
+ {this.state.isClient &&
313
+ createPortal(
314
314
  <Toolbar
315
315
  pathname={this.props.pathname}
316
316
  hideDefaultViewButtons
317
317
  inner={<span />}
318
- />
319
- </Portal>
320
- )}
318
+ />,
319
+ document.getElementById('toolbar'),
320
+ )}
321
321
  </Container>
322
322
  );
323
323
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import renderer from 'react-test-renderer';
2
+ import { render } from '@testing-library/react';
3
3
  import configureStore from 'redux-mock-store';
4
4
  import { Provider } from 'react-intl-redux';
5
5
  import { MemoryRouter } from 'react-router-dom';
@@ -8,9 +8,10 @@ import { __test__ as Search } from './Search';
8
8
 
9
9
  const mockStore = configureStore();
10
10
 
11
- jest.mock('react-portal', () => ({
12
- Portal: jest.fn(() => <div id="Portal" />),
13
- }));
11
+ jest.mock('../../manage/Toolbar/Toolbar', () =>
12
+ jest.fn(() => <div id="Portal" />),
13
+ );
14
+
14
15
  jest.mock('./SearchTags', () => jest.fn(() => <div id="search-tags" />));
15
16
 
16
17
  describe('Search', () => {
@@ -27,15 +28,16 @@ describe('Search', () => {
27
28
  const history = {
28
29
  location: { pathname: '/blog', search: '?SearchableText=blog' },
29
30
  };
30
- const component = renderer.create(
31
+ const { container } = render(
31
32
  <Provider store={store}>
32
33
  <MemoryRouter>
33
34
  <Search history={history} />
35
+ <div id="toolbar"></div>
34
36
  </MemoryRouter>
35
37
  </Provider>,
36
38
  );
37
- const json = component.toJSON();
38
- expect(json).toMatchSnapshot();
39
+
40
+ expect(container).toMatchSnapshot();
39
41
  });
40
42
 
41
43
  it('renders a search component', () => {
@@ -59,14 +61,15 @@ describe('Search', () => {
59
61
  const history = {
60
62
  location: { pathname: '/blog', search: '?SearchableText=blog' },
61
63
  };
62
- const component = renderer.create(
64
+ const { container } = render(
63
65
  <Provider store={store}>
64
66
  <MemoryRouter>
65
67
  <Search history={history} />
68
+ <div id="toolbar"></div>
66
69
  </MemoryRouter>
67
70
  </Provider>,
68
71
  );
69
- const json = component.toJSON();
70
- expect(json).toMatchSnapshot();
72
+
73
+ expect(container).toMatchSnapshot();
71
74
  });
72
75
  });
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import { MemoryRouter } from 'react-router-dom';
4
+ import SlotRenderer from './SlotRenderer';
5
+ import config from '@plone/volto/registry';
6
+
7
+ describe('SlotRenderer Component', () => {
8
+ const RouteConditionTrue = () => () => true;
9
+ const RouteConditionFalse = () => () => false;
10
+ const ContentTypeConditionTrue = () => () => true;
11
+ const ContentTypeConditionFalse = () => () => false;
12
+
13
+ test('renders a SlotRenderer component for the aboveContentTitle with two slots in the root', () => {
14
+ config.registerSlotComponent({
15
+ slot: 'toolbar',
16
+ name: 'save',
17
+ component: (props) => <div className="slot-component-true" />,
18
+ predicates: [RouteConditionTrue()],
19
+ });
20
+
21
+ config.registerSlotComponent({
22
+ slot: 'toolbar',
23
+ name: 'save',
24
+ component: (props) => <div className="slot-component-false" />,
25
+ predicates: [RouteConditionFalse(), ContentTypeConditionFalse()],
26
+ });
27
+
28
+ config.registerSlotComponent({
29
+ slot: 'toolbar',
30
+ name: 'edit',
31
+ component: (props) => <div className="slot-component-false" />,
32
+ predicates: [RouteConditionFalse()],
33
+ });
34
+
35
+ config.registerSlotComponent({
36
+ slot: 'toolbar',
37
+ name: 'edit',
38
+ component: (props) => (
39
+ <aside className="slot-component-true-predicates" />
40
+ ),
41
+ predicates: [RouteConditionTrue(), ContentTypeConditionTrue()],
42
+ });
43
+
44
+ const { container } = render(
45
+ <MemoryRouter initialEntries={[{ pathname: '/' }]}>
46
+ <SlotRenderer name="toolbar" content={{}} />
47
+ </MemoryRouter>,
48
+ );
49
+
50
+ const divSlot = container.querySelector('div');
51
+ expect(divSlot).toHaveClass('slot-component-true');
52
+ const asideSlot = container.querySelector('aside');
53
+ expect(asideSlot).toHaveClass('slot-component-true-predicates');
54
+ });
55
+ });
@@ -0,0 +1,54 @@
1
+ import { useLocation } from 'react-router-dom';
2
+ import config from '@plone/volto/registry';
3
+
4
+ import type { Content } from '@plone/types';
5
+
6
+ /*
7
+ Usage:
8
+ <SlotRenderer name="aboveContent" content={content} route={} />
9
+ */
10
+
11
+ const SlotRenderer = ({
12
+ name,
13
+ content,
14
+ navRoot,
15
+ }: {
16
+ name: string;
17
+ content: Content;
18
+ navRoot?: Content;
19
+ }) => {
20
+ const pathname = useLocation().pathname;
21
+
22
+ let slots = config.getSlot(name, {
23
+ content,
24
+ pathname,
25
+ // This is to cover the use case while adding a new content and we don't have
26
+ // have the navRoot information in the initial content. This will be
27
+ // useful for SlotRenderers rendered in the `Add` route.
28
+ navRoot: content?.['@components']?.navroot?.navroot || navRoot,
29
+ });
30
+
31
+ if (!slots) {
32
+ return null;
33
+ }
34
+
35
+ return (
36
+ <>
37
+ {slots.map(
38
+ ({
39
+ component,
40
+ name,
41
+ }: {
42
+ component: React.ComponentType<any>;
43
+ name: string;
44
+ }) => {
45
+ // ^^ Weird compilation issue for Jest tests, that forced to re-declare the type above
46
+ const SlotComponent = component;
47
+ return <SlotComponent key={name} />;
48
+ },
49
+ )}
50
+ </>
51
+ );
52
+ };
53
+
54
+ export default SlotRenderer;
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import { connect } from 'react-redux';
9
9
  import { compose } from 'redux';
10
10
  import { Redirect } from 'react-router-dom';
11
- import { Portal } from 'react-portal';
11
+ import { createPortal } from 'react-dom';
12
12
  import { injectIntl } from 'react-intl';
13
13
  import qs from 'query-string';
14
14
 
@@ -28,6 +28,7 @@ import {
28
28
  } from '@plone/volto/helpers';
29
29
 
30
30
  import config from '@plone/volto/registry';
31
+ import SlotRenderer from '../SlotRenderer/SlotRenderer';
31
32
 
32
33
  /**
33
34
  * View container class.
@@ -244,6 +245,7 @@ class View extends Component {
244
245
  : null
245
246
  }
246
247
  />
248
+ <SlotRenderer name="aboveContent" content={this.props.content} />
247
249
  <RenderedView
248
250
  key={this.props.content['@id']}
249
251
  content={this.props.content}
@@ -251,6 +253,7 @@ class View extends Component {
251
253
  token={this.props.token}
252
254
  history={this.props.history}
253
255
  />
256
+ <SlotRenderer name="belowContent" content={this.props.content} />
254
257
  {config.settings.showTags &&
255
258
  this.props.content.subjects &&
256
259
  this.props.content.subjects.length > 0 && (
@@ -266,11 +269,11 @@ class View extends Component {
266
269
  {this.props.content.allow_discussion && (
267
270
  <Comments pathname={this.props.pathname} />
268
271
  )}
269
- {this.state.isClient && (
270
- <Portal node={document.getElementById('toolbar')}>
271
- <Toolbar pathname={this.props.pathname} inner={<span />} />
272
- </Portal>
273
- )}
272
+ {this.state.isClient &&
273
+ createPortal(
274
+ <Toolbar pathname={this.props.pathname} inner={<span />} />,
275
+ document.getElementById('toolbar'),
276
+ )}
274
277
  </div>
275
278
  );
276
279
  }
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import renderer from 'react-test-renderer';
2
+ import { render } from '@testing-library/react';
3
3
  import configureStore from 'redux-mock-store';
4
4
  import { Provider } from 'react-intl-redux';
5
5
 
@@ -25,14 +25,18 @@ beforeAll(() => {
25
25
 
26
26
  const mockStore = configureStore();
27
27
 
28
- jest.mock('react-portal', () => ({
29
- Portal: jest.fn(() => <div id="Portal" />),
30
- }));
28
+ jest.mock('../../manage/Toolbar/Toolbar', () =>
29
+ jest.fn(() => <div id="Portal" />),
30
+ );
31
+
31
32
  jest.mock('../SocialSharing/SocialSharing', () =>
32
33
  jest.fn(() => <div id="SocialSharing" />),
33
34
  );
34
35
  jest.mock('../Comments/Comments', () => jest.fn(() => <div id="Comments" />));
35
36
  jest.mock('../Tags/Tags', () => jest.fn(() => <div id="Tags" />));
37
+ jest.mock('../SlotRenderer/SlotRenderer', () =>
38
+ jest.fn(() => <div id="SlotRenderer" />),
39
+ );
36
40
  jest.mock('../ContentMetadataTags/ContentMetadataTags', () =>
37
41
  jest.fn(() => <div id="ContentMetadataTags" />),
38
42
  );
@@ -147,13 +151,14 @@ describe('View', () => {
147
151
  messages: {},
148
152
  },
149
153
  });
150
- const component = renderer.create(
154
+ const { container } = render(
151
155
  <Provider store={store}>
152
156
  <View location={{ pathname: '/test' }} />
157
+ <div id="toolbar"></div>
153
158
  </Provider>,
154
159
  );
155
- const json = component.toJSON();
156
- expect(json).toMatchSnapshot();
160
+
161
+ expect(container).toMatchSnapshot();
157
162
  });
158
163
 
159
164
  it('renders a summary view', () => {
@@ -167,13 +172,14 @@ describe('View', () => {
167
172
  messages: {},
168
173
  },
169
174
  });
170
- const component = renderer.create(
175
+ const { container } = render(
171
176
  <Provider store={store}>
172
177
  <View location={{ pathname: '/test' }} />
178
+ <div id="toolbar"></div>
173
179
  </Provider>,
174
180
  );
175
- const json = component.toJSON();
176
- expect(json).toMatchSnapshot();
181
+
182
+ expect(container).toMatchSnapshot();
177
183
  });
178
184
 
179
185
  it('renders a tabular view', () => {
@@ -187,13 +193,14 @@ describe('View', () => {
187
193
  messages: {},
188
194
  },
189
195
  });
190
- const component = renderer.create(
196
+ const { container } = render(
191
197
  <Provider store={store}>
192
198
  <View location={{ pathname: '/test' }} />
199
+ <div id="toolbar"></div>
193
200
  </Provider>,
194
201
  );
195
- const json = component.toJSON();
196
- expect(json).toMatchSnapshot();
202
+
203
+ expect(container).toMatchSnapshot();
197
204
  });
198
205
 
199
206
  it('renders a document view', () => {
@@ -207,13 +214,14 @@ describe('View', () => {
207
214
  messages: {},
208
215
  },
209
216
  });
210
- const component = renderer.create(
217
+ const { container } = render(
211
218
  <Provider store={store}>
212
219
  <View location={{ pathname: '/test' }} />
220
+ <div id="toolbar"></div>
213
221
  </Provider>,
214
222
  );
215
- const json = component.toJSON();
216
- expect(json).toMatchSnapshot();
223
+
224
+ expect(container).toMatchSnapshot();
217
225
  });
218
226
 
219
227
  it('renders a new view element if the @id changed', () => {
@@ -235,16 +243,18 @@ describe('View', () => {
235
243
  messages: {},
236
244
  },
237
245
  });
238
- const component = renderer.create(
246
+ const { rerender } = render(
239
247
  <Provider store={store}>
240
248
  <View location={{ pathname: '/a' }} />
249
+ <div id="toolbar"></div>
241
250
  </Provider>,
242
251
  );
243
252
  expect(instanceCount).toBe(1);
244
253
  store.getState().content.data['@id'] = '/b';
245
- component.update(
254
+ rerender(
246
255
  <Provider store={store}>
247
256
  <View location={{ pathname: '/b' }} />
257
+ <div id="toolbar"></div>
248
258
  </Provider>,
249
259
  );
250
260
  expect(instanceCount).toBe(2);
@@ -75,7 +75,7 @@ let config = {
75
75
  okRoute: '/ok',
76
76
  apiPath,
77
77
  apiExpanders: [
78
- // Added here for documentation purposes, addded at the end because it
78
+ // Added here for documentation purposes, added at the end because it
79
79
  // depends on a value of this object.
80
80
  // Add the following expanders for only issuing a single request.
81
81
  // https://6.docs.plone.org/volto/configuration/settings-reference.html#term-apiExpanders
@@ -223,6 +223,7 @@ let config = {
223
223
  },
224
224
  addonRoutes: [],
225
225
  addonReducers: {},
226
+ slots: {},
226
227
  components,
227
228
  };
228
229
 
@@ -250,5 +251,6 @@ ConfigRegistry.widgets = config.widgets;
250
251
  ConfigRegistry.addonRoutes = config.addonRoutes;
251
252
  ConfigRegistry.addonReducers = config.addonReducers;
252
253
  ConfigRegistry.components = config.components;
254
+ ConfigRegistry.slots = config.slots;
253
255
 
254
256
  applyAddonConfiguration(ConfigRegistry);
@@ -12,8 +12,6 @@ import { AsyncConnectWithContext, AsyncConnect } from './AsyncConnect'; // , Asy
12
12
  import { asyncConnect, loadOnServer } from './';
13
13
  import { matchAllRoutes } from './utils';
14
14
 
15
- import '@testing-library/jest-dom/extend-expect';
16
-
17
15
  describe('<ReduxAsyncConnect />', () => {
18
16
  const initialEmptyState = {
19
17
  router: {
@@ -701,10 +701,13 @@ export function findBlocks(blocks, types, result = []) {
701
701
 
702
702
  Object.keys(blocks).forEach((blockId) => {
703
703
  const block = blocks[blockId];
704
+ // check blocks from data as well since some add-ons use that
705
+ // such as @eeacms/volto-tabs-block
706
+ const child_blocks = block.blocks || block.data?.blocks;
704
707
  if (types.includes(block['@type'])) {
705
708
  result.push(blockId);
706
- } else if (containerBlockTypes.includes(block['@type']) || block.blocks) {
707
- findBlocks(block.blocks, types, result);
709
+ } else if (containerBlockTypes.includes(block['@type']) || child_blocks) {
710
+ findBlocks(child_blocks, types, result);
708
711
  }
709
712
  });
710
713
 
@@ -0,0 +1,12 @@
1
+ import type { Content } from '@plone/types';
2
+ import { matchPath } from 'react-router-dom';
3
+
4
+ export function RouteCondition(path: string, exact?: boolean) {
5
+ return ({ pathname }: { pathname: string }) =>
6
+ Boolean(matchPath(pathname, { path, exact }));
7
+ }
8
+
9
+ export function ContentTypeCondition(contentType: string[]) {
10
+ return ({ content }: { content: Content }) =>
11
+ contentType.includes(content?.['@type']);
12
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useDetectClickOutside } from './useDetectClickOutside';
3
- import { Portal } from 'react-portal';
3
+ import { createPortal } from 'react-dom';
4
4
  import { usePopper } from 'react-popper';
5
5
  import { BlockChooser } from '@plone/volto/components';
6
6
 
@@ -44,10 +44,9 @@ function OpenedChooserWithPortal(props) {
44
44
  triggerKeys: ['Escape'],
45
45
  });
46
46
 
47
- return (
48
- <Portal node={document.getElementById('body')}>
49
- <div ref={blockChooserRef}>{`Hello ${props.id}`}</div>
50
- </Portal>
47
+ return createPortal(
48
+ <div ref={blockChooserRef}>{`Hello ${props.id}`}</div>,
49
+ document.getElementById('body'),
51
50
  );
52
51
  }
53
52
 
@@ -124,7 +123,7 @@ function TestComponentWithPortalAndPopper(props) {
124
123
  ref={setReferenceElement}
125
124
  onClick={() => setOpenMenu(true)}
126
125
  >{`Click me ${props.id}`}</button>
127
- <Portal node={document.getElementById('body')}>
126
+ {createPortal(
128
127
  <div
129
128
  ref={setPopperElement}
130
129
  style={styles.popper}
@@ -136,8 +135,9 @@ function TestComponentWithPortalAndPopper(props) {
136
135
  setOpenMenu={setOpenMenu}
137
136
  />
138
137
  )}
139
- </div>
140
- </Portal>
138
+ </div>,
139
+ document.body,
140
+ )}
141
141
  </div>
142
142
  );
143
143
  }
@@ -129,3 +129,4 @@ export {
129
129
  getWorkflowOptions,
130
130
  } from './Workflows/Workflows';
131
131
  export { getSiteAsyncPropExtender } from './Site';
132
+ export { ContentTypeCondition } from './Slots';
@@ -1,7 +1,7 @@
1
1
  import '@plone/volto/config'; // This is the bootstrap for the global config - client side
2
2
  import '@root/theme';
3
3
  import React from 'react';
4
- import { hydrate } from 'react-dom';
4
+ import { hydrateRoot } from 'react-dom/client';
5
5
  import { Provider } from 'react-redux';
6
6
  import { IntlProvider } from 'react-intl-redux';
7
7
  import { ConnectedRouter } from 'connected-react-router';
@@ -58,7 +58,8 @@ export default function client() {
58
58
  }
59
59
 
60
60
  loadableReady(() => {
61
- hydrate(
61
+ hydrateRoot(
62
+ document.getElementById('main'),
62
63
  <CookiesProvider>
63
64
  <Provider store={store}>
64
65
  <IntlProvider onError={reactIntlErrorHandler}>
@@ -70,7 +71,6 @@ export default function client() {
70
71
  </IntlProvider>
71
72
  </Provider>
72
73
  </CookiesProvider>,
73
- document.getElementById('main'),
74
74
  );
75
75
  });
76
76
  }
@@ -188,3 +188,4 @@ config.set('experimental', {
188
188
  enabled: false,
189
189
  },
190
190
  });
191
+ config.set('slots', {});
@@ -184,8 +184,8 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
184
184
  background: transparent;
185
185
  text-align: initial;
186
186
 
187
- &:focus {
188
- outline: none;
187
+ &:focus-visible {
188
+ outline: 1px auto;
189
189
  }
190
190
 
191
191
  &.ui {
@@ -291,8 +291,8 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
291
291
  cursor: pointer;
292
292
  text-align: initial;
293
293
 
294
- &:focus {
295
- outline: none;
294
+ &:focus-visible {
295
+ outline: 1px auto;
296
296
  }
297
297
  }
298
298
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
3
4
  "allowJs": true,
4
5
  "declaration": true,
5
6
  "emitDeclarationOnly": true,
@@ -1,5 +1,5 @@
1
1
  export default Actions;
2
- declare function Actions(props: any): JSX.Element;
2
+ declare function Actions(props: any): import("react/jsx-runtime").JSX.Element;
3
3
  declare namespace Actions {
4
4
  namespace propTypes {
5
5
  let pathname: any;
@@ -1,5 +1,2 @@
1
- declare const _default: React.ForwardRefExoticComponent<Omit<import("react-intl").WithIntlProps<import("react-intl").WrappedComponentProps<string>>, "ref"> & React.RefAttributes<React.ComponentType<import("react-intl").WrappedComponentProps<string>>>> & {
2
- WrappedComponent: React.ComponentType<import("react-intl").WrappedComponentProps<string>>;
3
- };
1
+ declare const _default: any;
4
2
  export default _default;
5
- import React from 'react';
@@ -1,5 +1,2 @@
1
- declare const _default: React.ForwardRefExoticComponent<Omit<import("react-intl").WithIntlProps<import("react-intl").WrappedComponentProps<string>>, "ref"> & React.RefAttributes<React.ComponentType<import("react-intl").WrappedComponentProps<string>>>> & {
2
- WrappedComponent: React.ComponentType<import("react-intl").WrappedComponentProps<string>>;
3
- };
1
+ declare const _default: any;
4
2
  export default _default;
5
- import React from 'react';
@@ -5,7 +5,7 @@ declare function Link({ children, className, entityKey, getEditorState, target }
5
5
  entityKey: any;
6
6
  getEditorState: any;
7
7
  target: any;
8
- }): JSX.Element;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
9
  declare namespace Link {
10
10
  export { propTypes };
11
11
  export namespace defaultProps {
@@ -1,3 +1,3 @@
1
- export function ButtonComponent(props: any): JSX.Element;
1
+ export function ButtonComponent(props: any): import("react/jsx-runtime").JSX.Element;
2
2
  export default BlockChooserButton;
3
- declare function BlockChooserButton(props: any): JSX.Element;
3
+ declare function BlockChooserButton(props: any): import("react/jsx-runtime").JSX.Element;