@plone/volto 19.0.0-alpha.9 → 19.1.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.
- package/.eslintignore +2 -0
- package/.eslintrc +26 -15
- package/AGENTS.md +47 -0
- package/CHANGELOG.md +543 -12
- package/README.md +22 -19
- package/babel.js +1 -9
- package/cypress/support/guillotina.js +1 -0
- package/cypress.config.js +1 -0
- package/global-test-setup.js +1 -2
- package/locales/af/LC_MESSAGES/volto.po +5516 -0
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +5516 -0
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +5516 -0
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +5516 -0
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +551 -359
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +5516 -0
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +5516 -0
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +5516 -0
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +222 -29
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +5516 -0
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +211 -15
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +5516 -0
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +5516 -0
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +5516 -0
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +336 -145
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +5516 -0
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +413 -222
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +5516 -0
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +212 -20
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +369 -178
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +5516 -0
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +5516 -0
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +5516 -0
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +220 -23
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +5516 -0
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +5516 -0
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +5516 -0
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +5516 -0
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +236 -39
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +254 -61
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +5516 -0
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +5516 -0
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +5516 -0
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +5516 -0
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +5516 -0
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +5516 -0
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +5516 -0
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +5516 -0
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +5516 -0
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +264 -71
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +5516 -0
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +5516 -0
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +862 -670
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +216 -25
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +5516 -0
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +248 -57
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +211 -19
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +5516 -0
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +5516 -0
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +5516 -0
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +5516 -0
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +5516 -0
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +5516 -0
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +5516 -0
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +5516 -0
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +5516 -0
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +5516 -0
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +5516 -0
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +5516 -0
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +5516 -0
- package/locales/vi.json +1 -1
- package/locales/volto.pot +205 -14
- package/locales/zh_CN/LC_MESSAGES/volto.po +211 -19
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +5516 -0
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +5516 -0
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +71 -149
- package/razzle.config.js +16 -25
- package/src/actions/blockTypes/blockTypes.ts +24 -0
- package/src/actions/controlpanels/controlpanels.js +7 -12
- package/src/actions/controlpanels/controlpanels.test.js +2 -3
- package/src/components/manage/Actions/Actions.test.jsx +1 -5
- package/src/components/manage/Add/Add.jsx +15 -10
- package/src/components/manage/Add/Add.test.jsx +10 -3
- package/src/components/manage/Aliases/Aliases.test.jsx +5 -2
- package/src/components/manage/BlockChooser/BlockChooser.jsx +8 -10
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +10 -7
- package/src/components/manage/Blocks/Block/BlocksForm.test.jsx +3 -14
- package/src/components/manage/Blocks/Block/Edit.jsx +19 -10
- package/src/components/manage/Blocks/Block/Order/Item.jsx +33 -14
- package/src/components/manage/Blocks/Block/Order/Item.test.jsx +90 -0
- package/src/components/manage/Blocks/Block/Order/Order.jsx +116 -67
- package/src/components/manage/Blocks/Block/Order/utilities.js +28 -11
- package/src/components/manage/Blocks/Block/Settings.test.jsx +1 -5
- package/src/components/manage/Blocks/Grid/View.jsx +14 -11
- package/src/components/manage/Blocks/Grid/context.js +3 -0
- package/src/components/manage/Blocks/HTML/Edit.test.jsx +1 -5
- package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +2 -5
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +2 -5
- package/src/components/manage/Blocks/Listing/Edit.jsx +1 -0
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +4 -0
- package/src/components/manage/Blocks/Maps/Body.jsx +37 -0
- package/src/components/manage/Blocks/Maps/Edit.jsx +6 -21
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Maps/View.jsx +16 -25
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Search/components/SelectFacet.jsx +22 -1
- package/src/components/manage/Blocks/Search/components/SelectFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Search/components/SortOn.jsx +8 -2
- package/src/components/manage/Blocks/Search/components/ToggleFacet.jsx +14 -0
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +10 -2
- package/src/components/manage/Blocks/Teaser/View.jsx +0 -1
- package/src/components/manage/Blocks/Teaser/utils.js +13 -0
- package/src/components/manage/Blocks/Teaser/utils.test.js +34 -0
- package/src/components/manage/Blocks/Title/Edit.jsx +5 -0
- package/src/components/manage/Blocks/Video/Body.jsx +69 -43
- package/src/components/manage/Blocks/Video/Body.test.jsx +122 -5
- package/src/components/manage/Blocks/Video/Edit.jsx +20 -2
- package/src/components/manage/Blocks/Video/Edit.test.jsx +6 -0
- package/src/components/manage/Blocks/Video/VideoSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Video/View.jsx +1 -0
- package/src/components/manage/Blocks/Video/View.test.jsx +29 -15
- package/src/components/manage/Blocks/Video/schema.js +14 -1
- package/src/components/manage/Contents/Contents.jsx +854 -747
- package/src/components/manage/Contents/Contents.test.jsx +9 -10
- package/src/components/manage/Contents/ContentsBreadcrumbs.jsx +4 -3
- package/src/components/manage/Contents/ContentsIndexHeader.jsx +47 -81
- package/src/components/manage/Contents/ContentsIndexHeader.test.jsx +10 -3
- package/src/components/manage/Contents/ContentsItem.jsx +226 -278
- package/src/components/manage/Contents/ContentsItem.test.jsx +10 -6
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsRenameModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsTagsModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsWorkflowModal.test.jsx +1 -5
- package/src/components/manage/Contents/DropZoneContent.jsx +339 -0
- package/src/components/manage/Contents/__mocks__/index.tsx +2 -18
- package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +7 -0
- package/src/components/manage/Controlpanels/AddonsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Aliases.test.jsx +8 -9
- package/src/components/manage/Controlpanels/BlockType.tsx +165 -0
- package/src/components/manage/Controlpanels/BlockTypes.tsx +145 -0
- package/src/components/manage/Controlpanels/ContentType.jsx +131 -222
- package/src/components/manage/Controlpanels/ContentType.test.jsx +13 -14
- package/src/components/manage/Controlpanels/ContentTypeLayout.test.jsx +12 -9
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentTypes.jsx +9 -2
- package/src/components/manage/Controlpanels/ContentTypes.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Controlpanel.jsx +122 -218
- package/src/components/manage/Controlpanels/Controlpanel.test.jsx +8 -33
- package/src/components/manage/Controlpanels/Controlpanels.jsx +28 -5
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +23 -8
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.test.jsx +7 -4
- package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
- package/src/components/manage/Controlpanels/ModerateComments.test.jsx +7 -4
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +1 -1
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Rules/ConfigureRule.test.jsx +9 -6
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Rules/Rules.test.jsx +7 -4
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +8 -9
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +10 -4
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +628 -631
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.jsx +624 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +70 -10
- package/src/components/manage/Controlpanels/VersionOverview.jsx +19 -6
- package/src/components/manage/Delete/Delete.test.jsx +13 -8
- package/src/components/manage/Diff/Diff.jsx +201 -298
- package/src/components/manage/Diff/Diff.test.jsx +8 -10
- package/src/components/manage/Diff/DiffField.test.jsx +1 -6
- package/src/components/manage/Display/Display.test.jsx +2 -11
- package/src/components/manage/Edit/Edit.test.jsx +12 -11
- package/src/components/manage/Form/BlockDataForm.test.jsx +1 -5
- package/src/components/manage/Form/Field.jsx +1 -69
- package/src/components/manage/Form/Form.jsx +17 -4
- package/src/components/manage/Form/Form.test.jsx +130 -5
- package/src/components/manage/Form/InlineForm.test.jsx +1 -5
- package/src/components/manage/Form/ModalForm.jsx +175 -97
- package/src/components/manage/Form/ModalForm.test.jsx +27 -5
- package/src/components/manage/Form/__mocks__/index.tsx +9 -27
- package/src/components/manage/History/History.jsx +209 -300
- package/src/components/manage/History/History.test.jsx +20 -9
- package/src/components/manage/LinksToItem/LinksToItem.test.jsx +7 -4
- package/src/components/manage/Multilingual/CompareLanguages.jsx +6 -6
- package/src/components/manage/Multilingual/CreateTranslation.jsx +16 -13
- package/src/components/manage/Multilingual/ManageTranslations.jsx +5 -5
- package/src/components/manage/Multilingual/ManageTranslations.test.jsx +15 -12
- package/src/components/manage/Multilingual/TranslationObject.jsx +11 -8
- package/src/components/manage/Preferences/ChangePassword.test.jsx +8 -9
- package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +10 -23
- package/src/components/manage/Rules/Rules.test.jsx +5 -2
- package/src/components/manage/Sharing/Sharing.jsx +21 -15
- package/src/components/manage/Sharing/Sharing.test.jsx +9 -6
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +10 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +25 -5
- package/src/components/manage/Sidebar/ObjectBrowserBody.test.jsx +52 -0
- package/src/components/manage/Sidebar/Sidebar.jsx +2 -0
- package/src/components/manage/Sidebar/Sidebar.test.jsx +4 -1
- package/src/components/manage/Sidebar/SidebarPortal.test.tsx +42 -0
- package/src/components/manage/Sidebar/SidebarPortal.tsx +48 -0
- package/src/components/manage/TemplateChooser/TemplateChooser.test.jsx +1 -0
- package/src/components/manage/Toast/Toast.jsx +32 -0
- package/src/components/manage/Toast/Toast.test.jsx +9 -5
- package/src/components/manage/Toolbar/PersonalTools.test.jsx +15 -0
- package/src/components/manage/Toolbar/Toolbar.jsx +109 -12
- package/src/components/manage/Toolbar/Toolbar.test.jsx +15 -10
- package/src/components/manage/Toolbar/Types.crash.test.jsx +48 -0
- package/src/components/manage/Toolbar/Types.jsx +6 -4
- package/src/components/manage/UniversalLink/UniversalLink.test.jsx +16 -0
- package/src/components/manage/UniversalLink/UniversalLink.tsx +1 -0
- package/src/components/manage/Widgets/AlignWidget.stories.jsx +9 -0
- package/src/components/manage/Widgets/AlignWidget.test.tsx +95 -0
- package/src/components/manage/Widgets/{AlignWidget.jsx → AlignWidget.tsx} +23 -7
- package/src/components/manage/Widgets/ArrayWidget.jsx +111 -88
- package/src/components/manage/Widgets/ArrayWidget.test.jsx +1 -12
- package/src/components/manage/Widgets/BlockAlignment.stories.tsx +104 -0
- package/src/components/manage/Widgets/BlockAlignment.test.tsx +104 -0
- package/src/components/manage/Widgets/BlockAlignment.tsx +88 -0
- package/src/components/manage/Widgets/BlockWidth.stories.tsx +69 -0
- package/src/components/manage/Widgets/BlockWidth.test.tsx +62 -0
- package/src/components/manage/Widgets/BlockWidth.tsx +101 -0
- package/src/components/manage/Widgets/ButtonsWidget.stories.jsx +61 -0
- package/src/components/manage/Widgets/ButtonsWidget.test.tsx +138 -0
- package/src/components/manage/Widgets/ButtonsWidget.tsx +195 -0
- package/src/components/manage/Widgets/CheckboxGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/DatetimeWidget.jsx +98 -54
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +56 -6
- package/src/components/manage/Widgets/FileWidget.jsx +7 -0
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +143 -163
- package/src/components/manage/Widgets/ImageWidget.jsx +18 -5
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +6 -0
- package/src/components/manage/Widgets/ObjectListWidget.test.jsx +2 -11
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +1 -5
- package/src/components/manage/Widgets/QueryWidget.jsx +137 -9
- package/src/components/manage/Widgets/QuerystringWidget.test.jsx +3 -1
- package/src/components/manage/Widgets/RadioGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.jsx +56 -50
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
- package/src/components/manage/Widgets/RegistryImageWidget.test.jsx +1 -0
- package/src/components/manage/Widgets/SchemaWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectStyling.jsx +52 -20
- package/src/components/manage/Widgets/SelectWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/Size.stories.tsx +69 -0
- package/src/components/manage/Widgets/Size.test.tsx +59 -0
- package/src/components/manage/Widgets/Size.tsx +78 -0
- package/src/components/manage/Widgets/TextWidget.jsx +4 -0
- package/src/components/manage/Widgets/TimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TokenWidget.jsx +142 -186
- package/src/components/manage/Widgets/TokenWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/UrlWidget.jsx +47 -18
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +2 -11
- package/src/components/manage/Widgets/__mocks__/index.tsx +33 -51
- package/src/components/manage/Widgets/index.tsx +21 -0
- package/src/components/manage/Workflow/Workflow.test.jsx +2 -11
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.jsx +1 -0
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.test.jsx +30 -0
- package/src/components/theme/App/App.jsx +5 -1
- package/src/components/theme/App/App.test.jsx +13 -10
- package/src/components/theme/Comments/CommentEditModal.test.jsx +1 -5
- package/src/components/theme/Comments/Comments.test.jsx +2 -11
- package/src/components/theme/ConnectionRefused/ConnectionRefused.jsx +3 -2
- package/src/components/theme/ContactForm/ContactForm.test.jsx +14 -13
- package/src/components/theme/Image/Image.jsx +14 -5
- package/src/components/theme/Image/Image.test.jsx +247 -146
- package/src/components/theme/InjectPloneComponentsCSS/InjectPloneComponentsCSS.tsx +7 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.tsx +3 -3
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +42 -12
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.test.jsx +6 -3
- package/src/components/theme/PasswordReset/PasswordReset.jsx +108 -191
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +1 -5
- package/src/components/theme/Register/Register.test.jsx +1 -5
- package/src/components/theme/Search/Search.jsx +230 -327
- package/src/components/theme/Search/Search.test.jsx +14 -14
- package/src/components/theme/Sitemap/Sitemap.jsx +22 -30
- package/src/components/theme/Sitemap/Sitemap.stories.jsx +82 -0
- package/src/components/theme/Sitemap/Sitemap.test.jsx +18 -0
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +12 -6
- package/src/components/theme/Unauthorized/Unauthorized.jsx +27 -24
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +31 -2
- package/src/components/theme/VideoEmbed/VideoEmbed.jsx +100 -0
- package/src/components/theme/View/EventDatesInfo.test.jsx +1 -6
- package/src/components/theme/View/EventView.stories.jsx +89 -0
- package/src/components/theme/View/EventView.test.jsx +1 -6
- package/src/components/theme/View/FileView.stories.jsx +50 -0
- package/src/components/theme/View/ImageView.jsx +2 -1
- package/src/components/theme/View/ImageView.test.jsx +3 -0
- package/src/components/theme/View/LinkView.stories.jsx +57 -0
- package/src/components/theme/View/ListingView.stories.jsx +70 -0
- package/src/components/theme/View/NewsItemView.stories.jsx +58 -0
- package/src/components/theme/View/RenderBlocks.jsx +8 -10
- package/src/components/theme/View/RenderBlocks.stories.jsx +112 -0
- package/src/components/theme/View/RenderBlocks.test.jsx +14 -4
- package/src/components/theme/View/SummaryView.stories.jsx +71 -0
- package/src/components/theme/View/TabularView.stories.jsx +66 -0
- package/src/components/theme/View/View.jsx +8 -1
- package/src/components/theme/View/View.test.jsx +37 -24
- package/src/components/theme/Widgets/DateWidget.jsx +4 -5
- package/src/components/theme/Widgets/DatetimeWidget.jsx +4 -5
- package/src/components/theme/Widgets/ImageWidget.test.jsx +31 -11
- package/src/components/theme/Widgets/RichTextWidget.jsx +1 -1
- package/src/config/Blocks.jsx +3 -0
- package/src/config/ControlPanels.js +2 -0
- package/src/config/Loadables.jsx +1 -5
- package/src/config/Widgets.jsx +7 -0
- package/src/config/index.js +10 -1
- package/src/config/slots.js +19 -0
- package/src/config/validation.ts +8 -0
- package/src/constants/ActionTypes.js +1 -0
- package/src/express-middleware/devproxy.js +3 -1
- package/src/express-middleware/files.js +1 -0
- package/src/express-middleware/files.test.js +59 -0
- package/src/express-middleware/images.js +1 -0
- package/src/express-middleware/images.test.js +50 -0
- package/src/helpers/Api/Api.js +2 -2
- package/src/helpers/AuthToken/AuthToken.js +1 -6
- package/src/helpers/Blocks/Blocks.js +113 -28
- package/src/helpers/Blocks/Blocks.test.js +100 -0
- package/src/helpers/Content/Content.js +23 -0
- package/src/helpers/Content/Content.test.js +39 -0
- package/src/helpers/Extensions/withBlockSchemaEnhancer.jsx +4 -1
- package/src/helpers/FormValidation/FormValidation.test.js +31 -0
- package/src/helpers/FormValidation/validators.ts +52 -6
- package/src/helpers/I18n/I18n.test.ts +44 -0
- package/src/helpers/I18n/I18n.ts +31 -0
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +7 -22
- package/src/helpers/MessageLabels/MessageLabels.js +5 -0
- package/src/helpers/Robots/Robots.js +1 -1
- package/src/helpers/Robots/Robots.test.js +34 -0
- package/src/helpers/Url/Url.js +1 -0
- package/src/helpers/Utils/Date.js +26 -1
- package/src/helpers/Utils/Date.test.js +237 -0
- package/src/helpers/Utils/Utils.jsx +17 -0
- package/src/helpers/Utils/Utils.test.jsx +39 -0
- package/src/helpers/Utils/withSaveAsDraft.jsx +33 -9
- package/src/helpers/index.js +1 -0
- package/src/hooks/user/useUser.js +1 -1
- package/src/internalChecks.test.ts +11 -0
- package/src/middleware/api.js +14 -5
- package/src/reducers/blockTypes/blockTypes.js +38 -0
- package/src/reducers/content/content.js +3 -18
- package/src/reducers/diff/diff.js +5 -1
- package/src/reducers/diff/diff.test.js +60 -4
- package/src/reducers/index.js +2 -0
- package/src/reducers/querystring/querystring.js +8 -1
- package/src/reducers/users/users.js +1 -1
- package/src/routes.js +10 -0
- package/src/server.jsx +14 -6
- package/src/start-client.jsx +21 -3
- package/test-addons-loader.js +3 -0
- package/test-setup-globals.js +56 -2
- package/theme/themes/default/elements/segment.variables +9 -16
- package/theme/themes/default/globals/site.variables +3 -3
- package/theme/themes/pastanaga/collections/form.overrides +22 -1
- package/theme/themes/pastanaga/elements/button.overrides +30 -3
- package/theme/themes/pastanaga/elements/segment.variables +1 -4
- package/theme/themes/pastanaga/extras/block-types.less +17 -0
- package/theme/themes/pastanaga/extras/contents.less +63 -4
- package/theme/themes/pastanaga/extras/main.less +16 -4
- package/theme/themes/pastanaga/extras/toolbar.less +10 -5
- package/theme/themes/pastanaga/extras/videoembed.less +22 -0
- package/theme/themes/pastanaga/extras/widgets.less +79 -0
- package/theme/themes/pastanaga/globals/site.variables +0 -3
- package/tsconfig.declarations.json +1 -1
- package/tsconfig.json +1 -1
- package/types/actions/blockTypes/blockTypes.d.ts +7 -0
- package/types/components/index.d.ts +1 -1
- package/types/components/manage/Blocks/Block/Order/Item.test.d.ts +1 -0
- package/types/components/manage/Blocks/Block/Order/utilities.d.ts +2 -1
- package/types/components/manage/Blocks/Grid/context.d.ts +1 -0
- package/types/components/manage/Blocks/Maps/Body.d.ts +9 -0
- package/types/components/manage/Blocks/Maps/View.d.ts +1 -1
- package/types/components/manage/Blocks/Teaser/utils.d.ts +5 -0
- package/types/components/manage/Blocks/Video/Body.d.ts +4 -2
- package/types/components/manage/Blocks/Video/schema.d.ts +4 -0
- package/types/components/manage/Contents/Contents.d.ts +1 -1
- package/types/components/manage/Contents/ContentsIndexHeader.d.ts +6 -11
- package/types/components/manage/Contents/ContentsItem.d.ts +3 -10
- package/types/components/manage/Contents/DropZoneContent.d.ts +2 -0
- package/types/components/manage/Contents/__mocks__/index.d.ts +2 -2
- package/types/components/manage/Controlpanels/BlockType.d.ts +7 -0
- package/types/components/manage/Controlpanels/BlockTypes.d.ts +7 -0
- package/types/components/manage/Controlpanels/ContentType.d.ts +2 -2
- package/types/components/manage/Controlpanels/Controlpanel.d.ts +2 -5
- package/types/components/manage/Controlpanels/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.ssr.test.d.ts +1 -0
- package/types/components/manage/Controlpanels/VersionOverview.d.ts +2 -1
- package/types/components/manage/Controlpanels/index.d.ts +3 -2
- package/types/components/manage/Diff/Diff.d.ts +7 -2
- package/types/components/manage/Form/__mocks__/index.d.ts +8 -8
- package/types/components/manage/Multilingual/ManageTranslations.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowser.d.ts +1 -1
- package/types/components/manage/Sidebar/ObjectBrowserBody.test.d.ts +1 -0
- package/types/components/manage/Sidebar/SidebarPortal.d.ts +7 -15
- package/types/components/manage/Toolbar/Types.crash.test.d.ts +1 -0
- package/types/components/manage/Widgets/AlignWidget.d.ts +8 -10
- package/types/components/manage/Widgets/AlignWidget.stories.d.ts +1 -0
- package/types/components/manage/Widgets/BlockAlignment.d.ts +7 -0
- package/types/components/manage/Widgets/BlockAlignment.stories.d.ts +8 -0
- package/types/components/manage/Widgets/BlockWidth.d.ts +7 -0
- package/types/components/manage/Widgets/BlockWidth.stories.d.ts +6 -0
- package/types/components/manage/Widgets/ButtonsWidget.d.ts +48 -1
- package/types/components/manage/Widgets/ButtonsWidget.stories.d.ts +3 -0
- package/types/components/manage/Widgets/FormFieldWrapper.d.ts +28 -5
- package/types/components/manage/Widgets/ImageWidget.d.ts +1 -1
- package/types/components/manage/Widgets/InternalUrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/ObjectBrowserWidget.d.ts +2 -0
- package/types/components/manage/Widgets/QueryWidget.d.ts +5 -2
- package/types/components/manage/Widgets/RecurrenceWidget/WeekdayOfTheMonthIndexField.d.ts +22 -5
- package/types/components/manage/Widgets/SelectStyling.d.ts +1 -0
- package/types/components/manage/Widgets/Size.d.ts +7 -0
- package/types/components/manage/Widgets/Size.stories.d.ts +6 -0
- package/types/components/manage/Widgets/UrlWidget.d.ts +1 -1
- package/types/components/manage/Widgets/__mocks__/index.d.ts +33 -33
- package/types/components/manage/Widgets/index.d.ts +11 -6
- package/types/components/theme/ConnectionRefused/ConnectionRefused.d.ts +2 -2
- package/types/components/theme/InjectPloneComponentsCSS/InjectPloneComponentsCSS.d.ts +3 -0
- package/types/components/theme/PasswordReset/PasswordReset.d.ts +6 -2
- package/types/components/theme/Search/Search.d.ts +1 -1
- package/types/components/theme/Sitemap/Sitemap.stories.d.ts +13 -0
- package/types/components/theme/SlotRenderer/SlotRenderer.d.ts +4 -5
- package/types/components/theme/Unauthorized/Unauthorized.d.ts +2 -2
- package/types/components/theme/VideoEmbed/VideoEmbed.d.ts +2 -0
- package/types/components/theme/View/EventView.stories.d.ts +19 -0
- package/types/components/theme/View/FileView.stories.d.ts +18 -0
- package/types/components/theme/View/LinkView.stories.d.ts +18 -0
- package/types/components/theme/View/ListingView.stories.d.ts +24 -0
- package/types/components/theme/View/NewsItemView.stories.d.ts +23 -0
- package/types/components/theme/View/RenderBlocks.stories.d.ts +23 -0
- package/types/components/theme/View/SummaryView.stories.d.ts +23 -0
- package/types/components/theme/View/TabularView.stories.d.ts +23 -0
- package/types/config/ControlPanels.d.ts +1 -0
- package/types/config/Views.d.ts +1 -1
- package/types/config/Widgets.d.ts +6 -0
- package/types/config/slots.d.ts +7 -0
- package/types/constants/ActionTypes.d.ts +1 -0
- package/types/helpers/Blocks/Blocks.d.ts +4 -0
- package/types/helpers/Content/Content.d.ts +7 -0
- package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +4 -5
- package/types/helpers/FormValidation/validators.d.ts +18 -1
- package/types/helpers/I18n/I18n.d.ts +20 -0
- package/types/helpers/Loadable/__mocks__/Loadable.d.ts +2 -2
- package/types/helpers/MessageLabels/MessageLabels.d.ts +100 -94
- package/types/helpers/Utils/Utils.d.ts +1 -0
- package/types/helpers/index.d.ts +1 -0
- package/types/reducers/blockTypes/blockTypes.d.ts +16 -0
- package/types/reducers/index.d.ts +2 -0
- package/types/routes.d.ts +7 -5
- package/vitest.config.mjs +84 -42
- package/webpack-plugins/webpack-less-plugin.js +1 -1
- package/webpack-plugins/webpack-scss-plugin.js +172 -0
- package/jest-addons-loader.js +0 -3
- package/jest-extender-plugin.js +0 -39
- package/jest-setup-afterenv.js +0 -2
- package/jest-svgsystem-transform.js +0 -10
- package/patches/patchit.sh +0 -2
- package/patches/razzle-jest.patch +0 -10
- package/src/components/manage/Contents/__mocks__/index.vitest.tsx +0 -5
- package/src/components/manage/Form/__mocks__/index.vitest.tsx +0 -73
- package/src/components/manage/Sidebar/SidebarPortal.jsx +0 -47
- package/src/components/manage/Sidebar/SidebarPortal.test.jsx +0 -26
- package/src/components/manage/Widgets/AlignWidget.test.jsx +0 -59
- package/src/components/manage/Widgets/ButtonsWidget.jsx +0 -41
- package/src/components/manage/Widgets/ButtonsWidget.test.jsx +0 -70
- package/src/components/manage/Widgets/__mocks__/index.vitest.tsx +0 -41
- package/src/helpers/Loadable/__mocks__/Loadable.vitest.jsx +0 -39
- package/test-setup-globals-vitest.js +0 -46
- package/theme/themes/pastanaga/extras/utils.less +0 -63
|
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import { CookiesProvider } from 'react-cookie';
|
|
5
6
|
|
|
6
7
|
import View from './View';
|
|
7
8
|
import config from '@plone/volto/registry';
|
|
@@ -158,10 +159,12 @@ describe('View', () => {
|
|
|
158
159
|
});
|
|
159
160
|
const { container } = render(
|
|
160
161
|
<Provider store={store}>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
<CookiesProvider>
|
|
163
|
+
<>
|
|
164
|
+
<View location={{ pathname: '/test' }} />
|
|
165
|
+
<div id="toolbar"></div>
|
|
166
|
+
</>
|
|
167
|
+
</CookiesProvider>
|
|
165
168
|
</Provider>,
|
|
166
169
|
);
|
|
167
170
|
|
|
@@ -181,10 +184,12 @@ describe('View', () => {
|
|
|
181
184
|
});
|
|
182
185
|
const { container } = render(
|
|
183
186
|
<Provider store={store}>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
<CookiesProvider>
|
|
188
|
+
<>
|
|
189
|
+
<View location={{ pathname: '/test' }} />
|
|
190
|
+
<div id="toolbar"></div>
|
|
191
|
+
</>
|
|
192
|
+
</CookiesProvider>
|
|
188
193
|
</Provider>,
|
|
189
194
|
);
|
|
190
195
|
|
|
@@ -204,10 +209,12 @@ describe('View', () => {
|
|
|
204
209
|
});
|
|
205
210
|
const { container } = render(
|
|
206
211
|
<Provider store={store}>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
<CookiesProvider>
|
|
213
|
+
<>
|
|
214
|
+
<View location={{ pathname: '/test' }} />
|
|
215
|
+
<div id="toolbar"></div>
|
|
216
|
+
</>
|
|
217
|
+
</CookiesProvider>
|
|
211
218
|
</Provider>,
|
|
212
219
|
);
|
|
213
220
|
|
|
@@ -227,10 +234,12 @@ describe('View', () => {
|
|
|
227
234
|
});
|
|
228
235
|
const { container } = render(
|
|
229
236
|
<Provider store={store}>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
<CookiesProvider>
|
|
238
|
+
<>
|
|
239
|
+
<View location={{ pathname: '/test' }} />
|
|
240
|
+
<div id="toolbar"></div>
|
|
241
|
+
</>
|
|
242
|
+
</CookiesProvider>
|
|
234
243
|
</Provider>,
|
|
235
244
|
);
|
|
236
245
|
|
|
@@ -258,20 +267,24 @@ describe('View', () => {
|
|
|
258
267
|
});
|
|
259
268
|
const { rerender } = render(
|
|
260
269
|
<Provider store={store}>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
<CookiesProvider>
|
|
271
|
+
<>
|
|
272
|
+
<View location={{ pathname: '/test' }} />
|
|
273
|
+
<div id="toolbar"></div>
|
|
274
|
+
</>
|
|
275
|
+
</CookiesProvider>
|
|
265
276
|
</Provider>,
|
|
266
277
|
);
|
|
267
278
|
expect(instanceCount).toBe(1);
|
|
268
279
|
store.getState().content.data['@id'] = '/b';
|
|
269
280
|
rerender(
|
|
270
281
|
<Provider store={store}>
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
282
|
+
<CookiesProvider>
|
|
283
|
+
<>
|
|
284
|
+
<View location={{ pathname: '/test' }} />
|
|
285
|
+
<div id="toolbar"></div>
|
|
286
|
+
</>
|
|
287
|
+
</CookiesProvider>
|
|
275
288
|
</Provider>,
|
|
276
289
|
);
|
|
277
290
|
expect(instanceCount).toBe(2);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
-
import moment from 'moment';
|
|
4
3
|
import { useSelector } from 'react-redux';
|
|
5
4
|
import { toBackendLang } from '@plone/volto/helpers/Utils/Utils';
|
|
5
|
+
import { formatDate } from '@plone/volto/helpers/Utils/Date';
|
|
6
6
|
|
|
7
7
|
const DateWidget = ({ value, children, className, format = 'll' }) => {
|
|
8
8
|
const lang = useSelector((state) => state.intl.locale);
|
|
9
|
-
|
|
9
|
+
const locale = toBackendLang(lang);
|
|
10
|
+
const formatted = formatDate({ date: value, format, locale });
|
|
10
11
|
return value ? (
|
|
11
12
|
<span className={cx(className, 'date', 'widget')}>
|
|
12
|
-
{children
|
|
13
|
-
? children(moment(value).format(format))
|
|
14
|
-
: moment(value).format(format)}
|
|
13
|
+
{children ? children(formatted) : formatted}
|
|
15
14
|
</span>
|
|
16
15
|
) : (
|
|
17
16
|
''
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
-
import moment from 'moment';
|
|
4
3
|
import { useSelector } from 'react-redux';
|
|
5
4
|
import { toBackendLang } from '@plone/volto/helpers/Utils/Utils';
|
|
5
|
+
import { formatDate } from '@plone/volto/helpers/Utils/Date';
|
|
6
6
|
|
|
7
7
|
const DatetimeWidget = ({ value, children, className, format = 'lll' }) => {
|
|
8
8
|
const lang = useSelector((state) => state.intl.locale);
|
|
9
|
-
|
|
9
|
+
const locale = toBackendLang(lang);
|
|
10
|
+
const formatted = formatDate({ date: value, format, locale });
|
|
10
11
|
return value ? (
|
|
11
12
|
<span className={cx(className, 'datetime', 'widget')}>
|
|
12
|
-
{children
|
|
13
|
-
? children(moment(value).format(format))
|
|
14
|
-
: moment(value).format(format)}
|
|
13
|
+
{children ? children(formatted) : formatted}
|
|
15
14
|
</span>
|
|
16
15
|
) : (
|
|
17
16
|
''
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer from 'react-test-renderer';
|
|
3
3
|
import ImageWidget from './ImageWidget';
|
|
4
|
+
import { Provider } from 'react-intl-redux';
|
|
5
|
+
import configureStore from 'redux-mock-store';
|
|
6
|
+
|
|
7
|
+
const mockStore = configureStore();
|
|
4
8
|
|
|
5
9
|
describe('ImageWidget', () => {
|
|
10
|
+
const store = mockStore({
|
|
11
|
+
intl: { locale: 'en', messages: {} },
|
|
12
|
+
site: { data: { 'plone.image_scales': { preview: {}, listing: {} } } },
|
|
13
|
+
});
|
|
14
|
+
|
|
6
15
|
it('renders an empty image view widget component', () => {
|
|
7
|
-
const component = renderer.create(
|
|
16
|
+
const component = renderer.create(
|
|
17
|
+
<Provider store={store}>
|
|
18
|
+
<ImageWidget />
|
|
19
|
+
</Provider>,
|
|
20
|
+
);
|
|
8
21
|
const json = component.toJSON();
|
|
9
22
|
expect(json).toMatchSnapshot();
|
|
10
23
|
});
|
|
11
24
|
|
|
12
25
|
it('renders an image view widget component', () => {
|
|
13
26
|
const component = renderer.create(
|
|
14
|
-
<
|
|
27
|
+
<Provider store={store}>
|
|
28
|
+
<ImageWidget
|
|
29
|
+
className="metadata"
|
|
30
|
+
value={{ download: '/foo-bar.png' }}
|
|
31
|
+
/>
|
|
32
|
+
</Provider>,
|
|
15
33
|
);
|
|
16
34
|
const json = component.toJSON();
|
|
17
35
|
expect(json).toMatchSnapshot();
|
|
@@ -19,15 +37,17 @@ describe('ImageWidget', () => {
|
|
|
19
37
|
|
|
20
38
|
it('renders an image view widget component with children', () => {
|
|
21
39
|
const component = renderer.create(
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
<Provider store={store}>
|
|
41
|
+
<ImageWidget
|
|
42
|
+
className="metadata"
|
|
43
|
+
value={{
|
|
44
|
+
download: '/foo-bar.png',
|
|
45
|
+
file_name: 'foo-bar.png',
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{(child) => <strong>{child}</strong>}
|
|
49
|
+
</ImageWidget>
|
|
50
|
+
</Provider>,
|
|
31
51
|
);
|
|
32
52
|
const json = component.toJSON();
|
|
33
53
|
expect(json).toMatchSnapshot();
|
package/src/config/Blocks.jsx
CHANGED
|
@@ -68,6 +68,7 @@ import {
|
|
|
68
68
|
import getListingBlockAsyncData from '@plone/volto/components/manage/Blocks/Listing/getAsyncData';
|
|
69
69
|
import { getImageBlockSizes } from '@plone/volto/components/manage/Blocks/Image/utils';
|
|
70
70
|
import { getLeadImageBlockSizes } from '@plone/volto/components/manage/Blocks/LeadImage/utils';
|
|
71
|
+
import { getTeaserBlockSizes } from '@plone/volto/components/manage/Blocks/Teaser/utils';
|
|
71
72
|
|
|
72
73
|
// block sidebar schemas (not the Dexterity Layout block settings schemas)
|
|
73
74
|
import ListingBlockSchema from '@plone/volto/components/manage/Blocks/Listing/schema';
|
|
@@ -351,6 +352,7 @@ const blocksConfig = {
|
|
|
351
352
|
restricted: false,
|
|
352
353
|
mostUsed: true,
|
|
353
354
|
sidebarTab: 1,
|
|
355
|
+
allowedPeertubeInstances: [],
|
|
354
356
|
},
|
|
355
357
|
toc: {
|
|
356
358
|
id: 'toc',
|
|
@@ -506,6 +508,7 @@ const blocksConfig = {
|
|
|
506
508
|
sidebarTab: 1,
|
|
507
509
|
blockSchema: TeaserSchema,
|
|
508
510
|
dataAdapter: TeaserBlockDataAdapter,
|
|
511
|
+
getSizes: getTeaserBlockSizes,
|
|
509
512
|
variations: [
|
|
510
513
|
{
|
|
511
514
|
id: 'default',
|
|
@@ -19,6 +19,7 @@ import rulesSVG from '@plone/volto/icons/content-existing.svg';
|
|
|
19
19
|
import undoControlPanelSVG from '@plone/volto/icons/undo-control-panel.svg';
|
|
20
20
|
import linkSVG from '@plone/volto/icons/link.svg';
|
|
21
21
|
import relationsSVG from '@plone/volto/icons/ahead.svg';
|
|
22
|
+
import contentListingSVG from '@plone/volto/icons/content-listing.svg';
|
|
22
23
|
import config from '@plone/volto/registry';
|
|
23
24
|
|
|
24
25
|
export const controlPanelsIcons = {
|
|
@@ -43,6 +44,7 @@ export const controlPanelsIcons = {
|
|
|
43
44
|
undo: undoControlPanelSVG,
|
|
44
45
|
aliases: linkSVG,
|
|
45
46
|
relations: relationsSVG,
|
|
47
|
+
'block-types': contentListingSVG,
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
export const filterControlPanels = (controlpanels = []) => {
|
package/src/config/Loadables.jsx
CHANGED
|
@@ -24,9 +24,6 @@ export const loadables = {
|
|
|
24
24
|
reactVirtualized: loadable.lib(() => import('react-virtualized'), {
|
|
25
25
|
ssr: false,
|
|
26
26
|
}),
|
|
27
|
-
reactSortableHOC: loadable.lib(() => import('react-sortable-hoc'), {
|
|
28
|
-
ssr: false,
|
|
29
|
-
}),
|
|
30
27
|
reactSelectAsyncPaginate: loadable.lib(
|
|
31
28
|
() => import('react-select-async-paginate'),
|
|
32
29
|
{ ssr: false },
|
|
@@ -46,11 +43,10 @@ export const loadables = {
|
|
|
46
43
|
diffLib: loadable.lib(() => import('diff')),
|
|
47
44
|
moment: loadable.lib(() => import('moment')),
|
|
48
45
|
reactDates: loadable.lib(() => import('react-dates')),
|
|
49
|
-
reactDnd: loadable.lib(() => import('react-dnd')),
|
|
50
|
-
reactDndHtml5Backend: loadable.lib(() => import('react-dnd-html5-backend')),
|
|
51
46
|
reactBeautifulDnd: loadable.lib(() => import('react-beautiful-dnd')),
|
|
52
47
|
rrule: loadable.lib(() => import('rrule')),
|
|
53
48
|
dndKitCore: loadable.lib(() => import('@dnd-kit/core')),
|
|
49
|
+
dndKitModifiers: loadable.lib(() => import('@dnd-kit/modifiers')),
|
|
54
50
|
dndKitSortable: loadable.lib(() => import('@dnd-kit/sortable')),
|
|
55
51
|
dndKitUtilities: loadable.lib(() => import('@dnd-kit/utilities')),
|
|
56
52
|
};
|
package/src/config/Widgets.jsx
CHANGED
|
@@ -35,6 +35,9 @@ import {
|
|
|
35
35
|
RecurrenceWidget,
|
|
36
36
|
RadioGroupWidget,
|
|
37
37
|
CheckboxGroupWidget,
|
|
38
|
+
Size,
|
|
39
|
+
BlockAlignment,
|
|
40
|
+
BlockWidth,
|
|
38
41
|
} from '@plone/volto/components/manage/Widgets';
|
|
39
42
|
|
|
40
43
|
import ArrayViewWidget from '@plone/volto/components/theme/Widgets/ArrayWidget';
|
|
@@ -102,6 +105,10 @@ export const widgetMapping = {
|
|
|
102
105
|
hidden: HiddenWidget,
|
|
103
106
|
radio_group: RadioGroupWidget,
|
|
104
107
|
checkbox_group: CheckboxGroupWidget,
|
|
108
|
+
// SemanticUI Free widgets
|
|
109
|
+
blockAlignment: BlockAlignment,
|
|
110
|
+
blockWidth: BlockWidth,
|
|
111
|
+
size: Size,
|
|
105
112
|
},
|
|
106
113
|
vocabulary: {
|
|
107
114
|
'plone.app.vocabularies.Catalog': ObjectBrowserWidget,
|
package/src/config/index.js
CHANGED
|
@@ -117,11 +117,12 @@ let config = {
|
|
|
117
117
|
defaultPageSize: 25,
|
|
118
118
|
supportedLanguages: Object.keys(languages),
|
|
119
119
|
navDepth: 1,
|
|
120
|
+
siteMapDepth: 4,
|
|
120
121
|
expressMiddleware: serverConfig.expressMiddleware, // BBB
|
|
121
122
|
defaultBlockType: 'slate',
|
|
122
123
|
verticalFormTabs: false,
|
|
123
124
|
useEmailAsLogin: false,
|
|
124
|
-
persistentReducers: ['blocksClipboard'],
|
|
125
|
+
persistentReducers: ['blocksClipboard.cut', 'blocksClipboard.copy'],
|
|
125
126
|
initialReducersBlacklist: [], // reducers in this list won't be hydrated in windows.__data
|
|
126
127
|
asyncPropsExtenders: [getSiteAsyncPropExtender], // per route asyncConnect customizers
|
|
127
128
|
contentIcons: contentIcons,
|
|
@@ -179,11 +180,19 @@ let config = {
|
|
|
179
180
|
includeSiteTitle: false,
|
|
180
181
|
titleAndSiteTitleSeparator: '-',
|
|
181
182
|
},
|
|
183
|
+
layout: {
|
|
184
|
+
// used to set `sizes` for images
|
|
185
|
+
tabletBreakpoint: 768,
|
|
186
|
+
defaultContainerWidth: 1200,
|
|
187
|
+
},
|
|
182
188
|
},
|
|
183
189
|
experimental: {
|
|
184
190
|
addBlockButton: {
|
|
185
191
|
enabled: true,
|
|
186
192
|
},
|
|
193
|
+
saveAsDraft: {
|
|
194
|
+
enabled: false,
|
|
195
|
+
},
|
|
187
196
|
},
|
|
188
197
|
widgets: {},
|
|
189
198
|
views: {},
|
package/src/config/slots.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
+
import loadable from '@loadable/component';
|
|
1
2
|
import RelatedItems from '@plone/volto/components/theme/RelatedItems/RelatedItems';
|
|
2
3
|
import Tags from '@plone/volto/components/theme/Tags/Tags';
|
|
4
|
+
import { isCmsUi } from '@plone/volto/helpers/Url/Url';
|
|
5
|
+
|
|
6
|
+
const InjectPloneComponentsCSS = loadable(
|
|
7
|
+
() =>
|
|
8
|
+
import(
|
|
9
|
+
'@plone/volto/components/theme/InjectPloneComponentsCSS/InjectPloneComponentsCSS'
|
|
10
|
+
),
|
|
11
|
+
{ fallback: null },
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const onlyCMSUI = ({ location }) => isCmsUi(location?.pathname);
|
|
3
15
|
|
|
4
16
|
const slots = {
|
|
17
|
+
aboveApp: [
|
|
18
|
+
{
|
|
19
|
+
name: 'plone-components-css',
|
|
20
|
+
component: InjectPloneComponentsCSS,
|
|
21
|
+
predicates: [onlyCMSUI],
|
|
22
|
+
},
|
|
23
|
+
],
|
|
5
24
|
belowContent: [
|
|
6
25
|
{
|
|
7
26
|
name: 'tags',
|
package/src/config/validation.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
endEventDateRangeValidator,
|
|
17
17
|
patternValidator,
|
|
18
18
|
defaultLanguageControlPanelValidator,
|
|
19
|
+
sizeValidator,
|
|
19
20
|
} from '@plone/volto/helpers/FormValidation/validators';
|
|
20
21
|
|
|
21
22
|
const registerValidators = (config: ConfigType) => {
|
|
@@ -33,6 +34,13 @@ const registerValidators = (config: ConfigType) => {
|
|
|
33
34
|
method: maxLengthValidator,
|
|
34
35
|
});
|
|
35
36
|
|
|
37
|
+
config.registerUtility({
|
|
38
|
+
name: 'size',
|
|
39
|
+
type: 'validator',
|
|
40
|
+
dependencies: { fieldType: 'object' },
|
|
41
|
+
method: sizeValidator,
|
|
42
|
+
});
|
|
43
|
+
|
|
36
44
|
config.registerUtility({
|
|
37
45
|
name: 'pattern',
|
|
38
46
|
type: 'validator',
|
|
@@ -148,3 +148,4 @@ export const GET_NAVROOT = 'GET_NAVROOT';
|
|
|
148
148
|
export const SET_FORM_DATA = 'SET_FORM_DATA';
|
|
149
149
|
export const SET_UI_STATE = 'SET_UI_STATE';
|
|
150
150
|
export const UPDATE_UPLOADED_FILES = 'UPDATE_UPLOADED_FILES';
|
|
151
|
+
export const GET_BLOCKTYPES_INDEX = 'GET_BLOCKTYPES_INDEX';
|
|
@@ -88,11 +88,13 @@ export default function devProxyMiddleware() {
|
|
|
88
88
|
.map((part) => '/_vh_' + part)
|
|
89
89
|
.join('')
|
|
90
90
|
: '';
|
|
91
|
+
const port =
|
|
92
|
+
apiPathURL.port || (apiPathURL.protocol === 'https:' ? 443 : 80);
|
|
91
93
|
const target =
|
|
92
94
|
config.settings.proxyRewriteTarget ||
|
|
93
95
|
`/VirtualHostBase/${apiPathURL.protocol.slice(0, -1)}/${
|
|
94
96
|
apiPathURL.hostname
|
|
95
|
-
}:${
|
|
97
|
+
}:${port}${instancePath}/++api++/VirtualHostRoot${vhSubpath}`;
|
|
96
98
|
|
|
97
99
|
return `${target}${path.replace(`${config.settings.subpathPrefix}/++api++`, '')}`;
|
|
98
100
|
},
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import filesMiddleware from './files';
|
|
2
|
+
import { getAPIResourceWithAuth } from '@plone/volto/helpers/Api/APIResourceWithAuth';
|
|
3
|
+
|
|
4
|
+
vi.mock('@plone/volto/helpers/Api/APIResourceWithAuth', () => ({
|
|
5
|
+
getAPIResourceWithAuth: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
describe('files middleware', () => {
|
|
9
|
+
it('handles requests containing @@download and forwards headers/body', async () => {
|
|
10
|
+
getAPIResourceWithAuth.mockResolvedValue({
|
|
11
|
+
headers: {
|
|
12
|
+
'content-type': 'text/plain',
|
|
13
|
+
'cache-status': 'Souin; hit; ttl=664',
|
|
14
|
+
},
|
|
15
|
+
body: 'OK',
|
|
16
|
+
get(name) {
|
|
17
|
+
return this.headers[name];
|
|
18
|
+
},
|
|
19
|
+
statusCode: 200,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const mw = filesMiddleware();
|
|
23
|
+
const layer = mw.stack.find(
|
|
24
|
+
(l) => l.regexp && l.regexp.source.includes('@@download'),
|
|
25
|
+
);
|
|
26
|
+
expect(layer).toBeTruthy();
|
|
27
|
+
|
|
28
|
+
const req = {
|
|
29
|
+
path: '/some/@@download',
|
|
30
|
+
method: 'GET',
|
|
31
|
+
app: { locals: {} },
|
|
32
|
+
};
|
|
33
|
+
const res = {
|
|
34
|
+
headers: {},
|
|
35
|
+
set(name, val) {
|
|
36
|
+
this.headers[name] = val;
|
|
37
|
+
},
|
|
38
|
+
status(code) {
|
|
39
|
+
this.statusCode = code;
|
|
40
|
+
return this;
|
|
41
|
+
},
|
|
42
|
+
send(body) {
|
|
43
|
+
this.body = body;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// invoke the middleware handler for that layer
|
|
48
|
+
layer.handle(req, res, (err) => {
|
|
49
|
+
if (err) throw err;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
await new Promise(process.nextTick);
|
|
53
|
+
|
|
54
|
+
expect(res.body).toBe('OK');
|
|
55
|
+
expect(res.statusCode).toBe(200);
|
|
56
|
+
expect(res.headers['content-type']).toBe('text/plain');
|
|
57
|
+
expect(res.headers['cache-status']).toBe('Souin; hit; ttl=664');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import imagesMiddleware from './images';
|
|
2
|
+
import { getAPIResourceWithAuth } from '@plone/volto/helpers/Api/APIResourceWithAuth';
|
|
3
|
+
|
|
4
|
+
vi.mock('@plone/volto/helpers/Api/APIResourceWithAuth', () => ({
|
|
5
|
+
getAPIResourceWithAuth: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
describe('images middleware', () => {
|
|
9
|
+
it('handles requests containing @@images and forwards headers/body', async () => {
|
|
10
|
+
getAPIResourceWithAuth.mockResolvedValue({
|
|
11
|
+
headers: {
|
|
12
|
+
'content-type': 'image/png',
|
|
13
|
+
'cache-status': 'Souin; hit; ttl=664',
|
|
14
|
+
},
|
|
15
|
+
body: 'OK',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const mw = imagesMiddleware();
|
|
19
|
+
const layer = mw.stack.find(
|
|
20
|
+
(l) => l.regexp && l.regexp.source.includes('@@images'),
|
|
21
|
+
);
|
|
22
|
+
expect(layer).toBeTruthy();
|
|
23
|
+
|
|
24
|
+
const req = {
|
|
25
|
+
path: '/some/@@images/image',
|
|
26
|
+
method: 'GET',
|
|
27
|
+
app: { locals: {} },
|
|
28
|
+
};
|
|
29
|
+
const res = {
|
|
30
|
+
headers: {},
|
|
31
|
+
set(name, val) {
|
|
32
|
+
this.headers[name] = val;
|
|
33
|
+
},
|
|
34
|
+
send(body) {
|
|
35
|
+
this.body = body;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// invoke the middleware handler for that layer
|
|
40
|
+
layer.handle(req, res, (err) => {
|
|
41
|
+
if (err) throw err;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await new Promise(process.nextTick);
|
|
45
|
+
|
|
46
|
+
expect(res.body).toBe('OK');
|
|
47
|
+
expect(res.headers['content-type']).toBe('image/png');
|
|
48
|
+
expect(res.headers['cache-status']).toBe('Souin; hit; ttl=664');
|
|
49
|
+
});
|
|
50
|
+
});
|
package/src/helpers/Api/Api.js
CHANGED
|
@@ -102,7 +102,7 @@ class Api {
|
|
|
102
102
|
request.attach.apply(request, attachment);
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
request.end((err, response) => {
|
|
105
|
+
request.end((err, response = {}) => {
|
|
106
106
|
if (
|
|
107
107
|
checkUrl &&
|
|
108
108
|
request.url &&
|
|
@@ -126,7 +126,7 @@ class Api {
|
|
|
126
126
|
if ([301, 302].includes(err?.status)) {
|
|
127
127
|
return reject({
|
|
128
128
|
code: err.status,
|
|
129
|
-
url: err.response
|
|
129
|
+
url: err.response?.headers?.location,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import Cookies from 'universal-cookie';
|
|
7
7
|
import jwtDecode from 'jwt-decode';
|
|
8
|
-
|
|
9
8
|
import { loginRenew } from '@plone/volto/actions/userSession/userSession';
|
|
10
9
|
import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies';
|
|
11
10
|
import { push } from 'connected-react-router';
|
|
@@ -35,7 +34,6 @@ export function persistAuthToken(store, req) {
|
|
|
35
34
|
} else {
|
|
36
35
|
currentValue = cookies.get('auth_token');
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
38
|
* handleChange method.
|
|
41
39
|
* @method handleChange
|
|
@@ -46,7 +44,6 @@ export function persistAuthToken(store, req) {
|
|
|
46
44
|
const previousValue = currentValue;
|
|
47
45
|
const state = store.getState();
|
|
48
46
|
currentValue = state.userSession.token;
|
|
49
|
-
|
|
50
47
|
if (
|
|
51
48
|
module.hot &&
|
|
52
49
|
module.hot.data &&
|
|
@@ -55,11 +52,11 @@ export function persistAuthToken(store, req) {
|
|
|
55
52
|
) {
|
|
56
53
|
currentValue = previousValue;
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
if (previousValue !== currentValue || initial) {
|
|
60
56
|
if (!currentValue) {
|
|
61
57
|
if (previousValue) {
|
|
62
58
|
cookies.remove('auth_token', { path: '/' });
|
|
59
|
+
cookies.remove('__ac', { path: '/' });
|
|
63
60
|
}
|
|
64
61
|
} else {
|
|
65
62
|
if (previousValue !== currentValue) {
|
|
@@ -97,11 +94,9 @@ export function persistAuthToken(store, req) {
|
|
|
97
94
|
}
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
|
-
|
|
101
97
|
store.subscribe(handleChange);
|
|
102
98
|
handleChange(true);
|
|
103
99
|
}
|
|
104
|
-
|
|
105
100
|
if (module?.hot) {
|
|
106
101
|
module.hot.dispose((data) => {
|
|
107
102
|
data.reloaded = true;
|