@plone/volto 19.0.0-alpha.3 → 19.0.0-alpha.30
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 +37 -6
- package/CHANGELOG.md +534 -2
- package/README.md +23 -21
- package/babel.js +1 -9
- package/cypress/docker/prefixed-rules.yml +26 -0
- package/cypress/docker/prefixed.yml +24 -0
- package/cypress/support/commands.js +12 -6
- 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 +5500 -0
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +5500 -0
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +5500 -0
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +5500 -0
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +559 -349
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +5500 -0
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +5500 -0
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +5500 -0
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +232 -21
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +5500 -0
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +226 -11
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +5500 -0
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +5500 -0
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +5500 -0
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +321 -111
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +5500 -0
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +404 -194
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +5500 -0
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +221 -11
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +220 -10
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +5500 -0
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +5501 -0
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +5500 -0
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +225 -10
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +5500 -0
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +5500 -0
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +5500 -0
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +5500 -0
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +239 -24
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +264 -53
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +5500 -0
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +5500 -0
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +5500 -0
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +5500 -0
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +5500 -0
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +5500 -0
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +5500 -0
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +5500 -0
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +5500 -0
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +243 -32
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +5500 -0
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +5500 -0
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +869 -659
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +229 -19
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +5500 -0
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +252 -42
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +220 -10
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +5500 -0
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +5500 -0
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +5500 -0
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +5500 -0
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +5500 -0
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +5500 -0
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +5501 -0
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +5500 -0
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +5500 -0
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +5500 -0
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +5501 -0
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +5500 -0
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +5500 -0
- package/locales/vi.json +1 -1
- package/locales/volto.pot +220 -10
- package/locales/zh_CN/LC_MESSAGES/volto.po +221 -10
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +5500 -0
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +5500 -0
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +72 -146
- package/razzle.config.js +32 -25
- package/src/actions/blockTypes/blockTypes.ts +24 -0
- package/src/components/manage/Actions/Actions.test.jsx +1 -5
- package/src/components/manage/Add/Add.jsx +15 -10
- package/src/components/manage/BlockChooser/BlockChooser.jsx +1 -0
- 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/EditBlockWrapper.jsx +9 -4
- package/src/components/manage/Blocks/Block/Order/Item.jsx +27 -13
- 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/Edit.jsx +5 -1
- package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +2 -5
- package/src/components/manage/Blocks/LeadImage/Edit.jsx +2 -2
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.jsx +1 -1
- 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/ImageGallery.jsx +6 -4
- package/src/components/manage/Blocks/Listing/ListingBody.jsx +4 -0
- package/src/components/manage/Blocks/Maps/Edit.jsx +2 -1
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +21 -4
- 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/Data.jsx +21 -7
- package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +11 -3
- 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 +22 -3
- 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 +697 -659
- package/src/components/manage/Contents/Contents.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsBreadcrumbs.jsx +6 -5
- package/src/components/manage/Contents/ContentsItem.jsx +1 -1
- 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 +338 -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/Aliases.test.jsx +1 -5
- package/src/components/manage/Controlpanels/BlockType.tsx +166 -0
- package/src/components/manage/Controlpanels/BlockTypes.tsx +145 -0
- package/src/components/manage/Controlpanels/ContentType.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentType.test.jsx +1 -5
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -1
- package/src/components/manage/Controlpanels/Controlpanels.jsx +28 -5
- package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -0
- package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
- package/src/components/manage/Controlpanels/Groups/GroupsControlpanel.jsx +3 -2
- package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
- package/src/components/manage/Controlpanels/Relations/Relations.jsx +1 -1
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Users/RenderUsers.jsx +156 -175
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +3 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +575 -631
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +58 -11
- package/src/components/manage/Diff/Diff.jsx +201 -298
- package/src/components/manage/Diff/Diff.test.jsx +1 -6
- 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 +1 -5
- package/src/components/manage/Form/BlockDataForm.test.jsx +1 -5
- package/src/components/manage/Form/Form.jsx +3 -3
- package/src/components/manage/Form/Form.test.jsx +1 -5
- package/src/components/manage/Form/InlineForm.jsx +2 -2
- package/src/components/manage/Form/InlineForm.test.jsx +1 -5
- package/src/components/manage/Form/ModalForm.jsx +12 -10
- package/src/components/manage/Form/ModalForm.test.jsx +27 -5
- package/src/components/manage/Form/__mocks__/index.tsx +9 -27
- 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/TranslationObject.jsx +11 -8
- package/src/components/manage/Preferences/ChangePassword.test.jsx +1 -5
- package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +1 -17
- package/src/components/manage/Sharing/Sharing.jsx +21 -15
- package/src/components/manage/Sidebar/ObjectBrowser.jsx +3 -0
- package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +18 -2
- package/src/components/manage/Sidebar/ObjectBrowserNav.jsx +2 -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.jsx +2 -1
- 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.jsx +2 -1
- package/src/components/manage/Toolbar/PersonalTools.test.jsx +15 -0
- package/src/components/manage/Toolbar/Toolbar.jsx +14 -4
- 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 +2 -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.test.jsx +1 -6
- 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 +102 -53
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +56 -6
- package/src/components/manage/Widgets/FileWidget.jsx +21 -8
- package/src/components/manage/Widgets/FormFieldWrapper.jsx +146 -168
- package/src/components/manage/Widgets/ImageWidget.jsx +177 -38
- package/src/components/manage/Widgets/InternalUrlWidget.jsx +2 -0
- package/src/components/manage/Widgets/ObjectBrowserWidget.jsx +8 -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/RadioGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
- package/src/components/manage/Widgets/RegistryImageWidget.test.jsx +4 -2
- 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.jsx +29 -12
- package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +1 -6
- 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/TimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TokenWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/UrlWidget.jsx +49 -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/Avatar/Avatar.jsx +2 -1
- 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 +1 -5
- package/src/components/theme/Image/Image.jsx +25 -13
- 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 +89 -0
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +42 -12
- package/src/components/theme/PasswordReset/PasswordReset.jsx +108 -191
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +1 -5
- package/src/components/theme/PreviewImage/PreviewImage.jsx +1 -1
- package/src/components/theme/Register/Register.test.jsx +1 -5
- package/src/components/theme/RequestTimeout/RequestTimeout.jsx +1 -1
- package/src/components/theme/Sitemap/Sitemap.stories.jsx +82 -0
- package/src/components/theme/SlotRenderer/SlotRenderer.tsx +12 -6
- package/src/components/theme/Unauthorized/Unauthorized.jsx +35 -25
- package/src/components/theme/Unauthorized/Unauthorized.test.jsx +28 -1
- 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/Widgets/ImageWidget.jsx +2 -1
- package/src/components/theme/Widgets/ImageWidget.test.jsx +31 -11
- package/src/config/Blocks.jsx +3 -0
- package/src/config/ControlPanels.js +3 -0
- package/src/config/Widgets.jsx +7 -0
- package/src/config/index.js +19 -12
- package/src/config/server.js +0 -2
- 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 +22 -5
- 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/APIResourceWithAuth.js +8 -3
- package/src/helpers/Api/Api.js +7 -4
- package/src/helpers/AsyncConnect/ssr.js +4 -1
- 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/Content/withClientSideContent.jsx +35 -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/Html/Html.jsx +13 -4
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +7 -22
- package/src/helpers/MessageLabels/MessageLabels.js +10 -0
- package/src/helpers/Sitemap/Sitemap.js +4 -4
- package/src/helpers/Url/Url.js +33 -2
- package/src/helpers/Url/Url.test.js +62 -0
- package/src/helpers/Utils/Utils.jsx +17 -0
- package/src/helpers/Utils/Utils.test.jsx +39 -0
- package/src/hooks/user/useUser.js +1 -1
- package/src/internalChecks.test.ts +11 -0
- package/src/middleware/api.js +17 -8
- package/src/middleware/storeProtectLoadUtils.test.js +3 -3
- 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 +13 -1
- package/src/server.jsx +47 -13
- package/src/start-client.jsx +9 -2
- package/src/start-server.js +9 -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/pastanaga/collections/form.overrides +1 -1
- package/theme/themes/pastanaga/elements/segment.variables +1 -4
- package/theme/themes/pastanaga/extras/block-types.less +17 -0
- package/theme/themes/pastanaga/extras/blocks.less +19 -0
- package/theme/themes/pastanaga/extras/contents.less +75 -0
- package/theme/themes/pastanaga/extras/main.less +20 -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/tsconfig.declarations.json +1 -1
- package/tsconfig.json +4 -5
- 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/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/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/Relations/RelationsMatrix.d.ts +1 -1
- package/types/components/manage/Controlpanels/Users/RenderUsers.d.ts +18 -2
- package/types/components/manage/Controlpanels/Users/UsersControlpanel.d.ts +6 -2
- package/types/components/manage/Controlpanels/index.d.ts +2 -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/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 +41 -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/Utils.d.ts +12 -18
- 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/LanguageSelector/LanguageSelector.d.ts +3 -10
- package/types/components/theme/PasswordReset/PasswordReset.d.ts +6 -2
- 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/Content/withClientSideContent.d.ts +1 -0
- package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +4 -5
- package/types/helpers/FormValidation/validators.d.ts +18 -1
- package/types/helpers/Helmet/Helmet.d.ts +1 -1
- package/types/helpers/Loadable/__mocks__/Loadable.d.ts +2 -2
- package/types/helpers/MessageLabels/MessageLabels.d.ts +105 -93
- package/types/helpers/Url/Url.d.ts +14 -0
- package/types/helpers/Url/bulkFlattenToAppURL.d.ts +5 -0
- package/types/helpers/Utils/Utils.d.ts +1 -0
- package/types/reducers/blockTypes/blockTypes.d.ts +16 -0
- package/types/reducers/index.d.ts +3 -0
- package/types/routes.d.ts +7 -5
- package/types/start-client.d.ts +0 -1
- 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/cypress/downloads/downloads.html +0 -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/package-why.json +0 -34
- 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/components/theme/LanguageSelector/LanguageSelector.jsx +0 -79
- 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
- /package/src/components/theme/LanguageSelector/{LanguageSelector.test.jsx → LanguageSelector.test.tsx} +0 -0
|
@@ -35,6 +35,7 @@ export function normalizeString(str: string): string;
|
|
|
35
35
|
*/
|
|
36
36
|
export function isInteractiveElement(element: node, interactiveElements?: string[]): boolean;
|
|
37
37
|
export function safeWrapper(func: Function): (config: any) => any;
|
|
38
|
+
export function getErrorMessage(error: object): string;
|
|
38
39
|
export function getInitials(title: any, limit: any): string;
|
|
39
40
|
export function getColor(name: any): any;
|
|
40
41
|
export function parseDateTime(locale: string, value: string, format: string, moment: any): any | string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function blockTypes(state?: {
|
|
2
|
+
error: any;
|
|
3
|
+
items: {};
|
|
4
|
+
loaded: boolean;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
}, action?: {}): {
|
|
7
|
+
error: any;
|
|
8
|
+
items: {};
|
|
9
|
+
loaded: boolean;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
error: any;
|
|
13
|
+
items: any;
|
|
14
|
+
loaded: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
};
|
|
@@ -49,7 +49,9 @@ declare namespace reducers {
|
|
|
49
49
|
export { userschema };
|
|
50
50
|
export { site };
|
|
51
51
|
export { navroot };
|
|
52
|
+
export { blockTypes };
|
|
52
53
|
}
|
|
54
|
+
import { intlReducer } from 'react-intl-redux';
|
|
53
55
|
import reduxAsyncConnect from './asyncConnect/asyncConnect';
|
|
54
56
|
import actions from '@plone/volto/reducers/actions/actions';
|
|
55
57
|
import addons from '@plone/volto/reducers/addons/addons';
|
|
@@ -98,3 +100,4 @@ import transactions from './transactions/transactions';
|
|
|
98
100
|
import userschema from './userschema/userschema';
|
|
99
101
|
import site from './site/site';
|
|
100
102
|
import navroot from './navroot/navroot';
|
|
103
|
+
import blockTypes from './blockTypes/blockTypes';
|
package/types/routes.d.ts
CHANGED
|
@@ -12,22 +12,23 @@ export const multilingualRoutes: ({
|
|
|
12
12
|
exact?: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
path: string;
|
|
15
|
-
component:
|
|
15
|
+
component: () => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
exact: boolean;
|
|
17
17
|
})[];
|
|
18
18
|
export const defaultRoutes: ({
|
|
19
19
|
path: string;
|
|
20
20
|
component: any;
|
|
21
21
|
exact?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
component: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
22
24
|
} | {
|
|
23
25
|
path: string;
|
|
24
26
|
component: any;
|
|
25
27
|
exact: boolean;
|
|
26
|
-
} | {
|
|
27
|
-
component: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
} | {
|
|
29
29
|
path: string[];
|
|
30
30
|
component: any;
|
|
31
|
+
exact?: undefined;
|
|
31
32
|
})[];
|
|
32
33
|
export default routes;
|
|
33
34
|
/**
|
|
@@ -46,14 +47,15 @@ declare const routes: {
|
|
|
46
47
|
path: string;
|
|
47
48
|
component: any;
|
|
48
49
|
exact?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
component: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
49
52
|
} | {
|
|
50
53
|
path: string;
|
|
51
54
|
component: any;
|
|
52
55
|
exact: boolean;
|
|
53
|
-
} | {
|
|
54
|
-
component: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
55
56
|
} | {
|
|
56
57
|
path: string[];
|
|
57
58
|
component: any;
|
|
59
|
+
exact?: undefined;
|
|
58
60
|
})[];
|
|
59
61
|
}[];
|
package/types/start-client.d.ts
CHANGED
package/vitest.config.mjs
CHANGED
|
@@ -12,66 +12,108 @@ const __dirname = path.dirname(__filename);
|
|
|
12
12
|
|
|
13
13
|
const projectRoot = path.resolve(__dirname);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const sharedAliases = {
|
|
16
|
+
'@plone/volto': path.resolve(__dirname, 'src'),
|
|
17
|
+
'@plone/volto-slate': path.resolve(__dirname, '../volto-slate/src'),
|
|
18
|
+
'@root': path.resolve(__dirname, 'src'),
|
|
19
|
+
'@plone/components': path.resolve(__dirname, '../components/src'),
|
|
20
|
+
'promise-file-reader': require.resolve('promise-file-reader'),
|
|
21
|
+
'react-dropzone': require.resolve('react-dropzone'),
|
|
22
|
+
'prop-types': require.resolve('prop-types'),
|
|
23
|
+
'react-intl-redux': require.resolve('react-intl-redux'),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// volto-slate specific aliases
|
|
27
|
+
const voltoSlateAliases = {
|
|
28
|
+
...sharedAliases,
|
|
29
|
+
'react-test-renderer': require.resolve('react-test-renderer'),
|
|
30
|
+
'redux': require.resolve('redux'),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const sharedPlugins = [
|
|
34
|
+
react(),
|
|
35
|
+
svgLoader({
|
|
36
|
+
svgoConfig: {
|
|
37
|
+
plugins: [
|
|
38
|
+
{
|
|
39
|
+
name: 'preset-default',
|
|
40
|
+
params: {
|
|
41
|
+
overrides: {
|
|
42
|
+
convertPathData: false,
|
|
43
|
+
removeViewBox: false,
|
|
28
44
|
},
|
|
29
45
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
],
|
|
36
|
-
resolve: {
|
|
37
|
-
alias: {
|
|
38
|
-
'@plone/volto': path.resolve(__dirname, 'src'),
|
|
39
|
-
'@plone/volto-slate': path.resolve(__dirname, '../volto-slate/src'),
|
|
40
|
-
'@root': path.resolve(__dirname, 'src'),
|
|
41
|
-
'promise-file-reader': require.resolve('promise-file-reader'),
|
|
42
|
-
'react-dropzone': require.resolve('react-dropzone'),
|
|
43
|
-
'prop-types': require.resolve('prop-types'),
|
|
46
|
+
},
|
|
47
|
+
'removeTitle',
|
|
48
|
+
'removeUselessStrokeAndFill',
|
|
49
|
+
],
|
|
44
50
|
},
|
|
51
|
+
}),
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
export default defineConfig({
|
|
55
|
+
plugins: sharedPlugins,
|
|
56
|
+
resolve: {
|
|
57
|
+
alias: sharedAliases,
|
|
45
58
|
},
|
|
46
59
|
test: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
projects: [
|
|
61
|
+
// Volto main project
|
|
62
|
+
{
|
|
63
|
+
test: {
|
|
64
|
+
name: 'volto',
|
|
65
|
+
root: '.',
|
|
66
|
+
isolate: true,
|
|
67
|
+
globals: true,
|
|
68
|
+
environment: 'jsdom',
|
|
69
|
+
setupFiles: [
|
|
70
|
+
`${projectRoot}/test-setup-globals.js`,
|
|
71
|
+
`${projectRoot}/test-setup-config.jsx`,
|
|
72
|
+
`${projectRoot}/test-addons-loader.js`,
|
|
73
|
+
],
|
|
74
|
+
globalSetup: `${projectRoot}/global-test-setup.js`,
|
|
75
|
+
},
|
|
76
|
+
resolve: {
|
|
77
|
+
alias: sharedAliases,
|
|
78
|
+
},
|
|
79
|
+
plugins: sharedPlugins,
|
|
80
|
+
},
|
|
81
|
+
// volto-slate project
|
|
82
|
+
{
|
|
83
|
+
test: {
|
|
84
|
+
name: 'volto-slate',
|
|
85
|
+
root: '../volto-slate',
|
|
86
|
+
isolate: true,
|
|
87
|
+
globals: true,
|
|
88
|
+
environment: 'jsdom',
|
|
89
|
+
setupFiles: [
|
|
90
|
+
`${projectRoot}/test-setup-globals.js`,
|
|
91
|
+
`${projectRoot}/test-setup-config.jsx`,
|
|
92
|
+
`${projectRoot}/test-addons-loader.js`,
|
|
93
|
+
],
|
|
94
|
+
globalSetup: `${projectRoot}/global-test-setup.js`,
|
|
95
|
+
},
|
|
96
|
+
resolve: {
|
|
97
|
+
alias: voltoSlateAliases,
|
|
98
|
+
},
|
|
99
|
+
plugins: sharedPlugins,
|
|
100
|
+
},
|
|
59
101
|
],
|
|
60
|
-
|
|
102
|
+
snapshotFormat: { printBasicPrototype: false },
|
|
61
103
|
coverage: {
|
|
62
104
|
provider: 'v8',
|
|
63
105
|
reporter: ['text', 'json', 'html'],
|
|
64
106
|
include: [
|
|
65
107
|
'src/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
66
108
|
'__test__/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
109
|
+
'../volto-slate/src/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
67
110
|
],
|
|
68
111
|
exclude: [
|
|
69
112
|
'node_modules/**',
|
|
70
113
|
'**/dist/**',
|
|
71
114
|
'**/*.config.{js,ts}',
|
|
72
|
-
'**/jest-*.js',
|
|
73
115
|
],
|
|
74
116
|
},
|
|
75
117
|
css: true,
|
|
76
118
|
},
|
|
77
|
-
});
|
|
119
|
+
});
|
|
@@ -143,7 +143,7 @@ module.exports = (userOptions = {}) => ({
|
|
|
143
143
|
/packages\/volto\/theme/,
|
|
144
144
|
/plone\.volto\/theme/,
|
|
145
145
|
/node_modules\/semantic-ui-less/,
|
|
146
|
-
...Object.values(registry.
|
|
146
|
+
...Object.values(registry.packages).map((p) => p.modulePath),
|
|
147
147
|
],
|
|
148
148
|
use: isServer
|
|
149
149
|
? [
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* Razzle SCSS Webpack Plugin `razzle-plugin-scss`
|
|
2
|
+
Forked from https://github.com/jaredpalmer/razzle/blob/master/packages/razzle-plugin-scss/index.js
|
|
3
|
+
version 4.2.18
|
|
4
|
+
See Volto's upgrade guide for more information:
|
|
5
|
+
https://6.docs.plone.org/volto/upgrade-guide/index.html
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const autoprefixer = require('autoprefixer');
|
|
9
|
+
const merge = require('deepmerge');
|
|
10
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
11
|
+
const paths = require('@plone/razzle/config/paths');
|
|
12
|
+
const postcssLoadConfig = require('postcss-load-config');
|
|
13
|
+
|
|
14
|
+
const hasPostCssConfig = () => {
|
|
15
|
+
try {
|
|
16
|
+
return !!postcssLoadConfig.sync();
|
|
17
|
+
} catch (_error) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
modifyWebpackConfig(opts) {
|
|
24
|
+
const isServer = opts.env.target !== 'web';
|
|
25
|
+
const constantEnv = opts.env.dev ? 'dev' : 'prod';
|
|
26
|
+
|
|
27
|
+
const razzleOptions = opts.options.razzleOptions;
|
|
28
|
+
const config = Object.assign({}, opts.webpackConfig);
|
|
29
|
+
|
|
30
|
+
const defaultOptions = {
|
|
31
|
+
postcss: {
|
|
32
|
+
dev: {
|
|
33
|
+
sourceMap: true,
|
|
34
|
+
ident: 'postcss',
|
|
35
|
+
},
|
|
36
|
+
prod: {
|
|
37
|
+
sourceMap: razzleOptions.enableSourceMaps,
|
|
38
|
+
ident: 'postcss',
|
|
39
|
+
},
|
|
40
|
+
plugins: [
|
|
41
|
+
[
|
|
42
|
+
autoprefixer,
|
|
43
|
+
{
|
|
44
|
+
overrideBrowserslist: opts.options.razzleOptions.browserslist || [
|
|
45
|
+
'>1%',
|
|
46
|
+
'last 4 versions',
|
|
47
|
+
'Firefox ESR',
|
|
48
|
+
'not ie < 9',
|
|
49
|
+
],
|
|
50
|
+
flexbox: 'no-2009',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
sass: {
|
|
56
|
+
dev: {
|
|
57
|
+
sassOptions: {
|
|
58
|
+
sourceMap: true,
|
|
59
|
+
includePaths: [paths.appNodeModules],
|
|
60
|
+
outputStyle: 'expanded',
|
|
61
|
+
silenceDeprecations: ['legacy-js-api', 'mixed-decls', 'import'],
|
|
62
|
+
quiet: true,
|
|
63
|
+
quietDeps: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
prod: {
|
|
67
|
+
sassOptions: {
|
|
68
|
+
// XXX Source maps are required for the resolve-url-loader to properly
|
|
69
|
+
// function. Disable them in later stages if you do not want source maps.
|
|
70
|
+
sourceMap: true,
|
|
71
|
+
sourceMapContents: false,
|
|
72
|
+
includePaths: [paths.appNodeModules],
|
|
73
|
+
outputStyle: 'expanded',
|
|
74
|
+
silenceDeprecations: ['legacy-js-api', 'mixed-decls', 'import'],
|
|
75
|
+
quiet: true,
|
|
76
|
+
quietDeps: true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
css: {
|
|
81
|
+
dev: {
|
|
82
|
+
sourceMap: true,
|
|
83
|
+
importLoaders: 1,
|
|
84
|
+
modules: {
|
|
85
|
+
auto: true,
|
|
86
|
+
localIdentName: '[name]__[local]___[hash:base64:5]',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
prod: {
|
|
90
|
+
sourceMap: razzleOptions.enableSourceMaps,
|
|
91
|
+
importLoaders: 1,
|
|
92
|
+
modules: {
|
|
93
|
+
auto: true,
|
|
94
|
+
localIdentName: '[name]__[local]___[hash:base64:5]',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
style: {},
|
|
99
|
+
resolveUrl: {
|
|
100
|
+
dev: {},
|
|
101
|
+
prod: {},
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const options = Object.assign(
|
|
106
|
+
{},
|
|
107
|
+
defaultOptions,
|
|
108
|
+
opts.options.pluginOptions,
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const styleLoader = {
|
|
112
|
+
loader: require.resolve('style-loader'),
|
|
113
|
+
options: options.style,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const cssLoader = {
|
|
117
|
+
loader: require.resolve('css-loader'),
|
|
118
|
+
options: options.css[constantEnv],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const resolveUrlLoader = {
|
|
122
|
+
loader: require.resolve('resolve-url-loader'),
|
|
123
|
+
options: options.resolveUrl[constantEnv],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const postCssLoader = {
|
|
127
|
+
loader: require.resolve('postcss-loader'),
|
|
128
|
+
options: hasPostCssConfig()
|
|
129
|
+
? undefined
|
|
130
|
+
: {
|
|
131
|
+
postcssOptions: Object.assign({}, options.postcss[constantEnv], {
|
|
132
|
+
plugins: options.postcss.plugins,
|
|
133
|
+
}),
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const sassLoader = {
|
|
138
|
+
loader: require.resolve('sass-loader'),
|
|
139
|
+
options: options.sass[constantEnv],
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
config.module.rules = [
|
|
143
|
+
...config.module.rules,
|
|
144
|
+
{
|
|
145
|
+
test: /\.(sa|sc)ss$/,
|
|
146
|
+
use: isServer
|
|
147
|
+
? [
|
|
148
|
+
{
|
|
149
|
+
loader: require.resolve('css-loader'),
|
|
150
|
+
options: merge(options.css[constantEnv], {
|
|
151
|
+
modules: {
|
|
152
|
+
exportOnlyLocals: true,
|
|
153
|
+
},
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
resolveUrlLoader,
|
|
157
|
+
postCssLoader,
|
|
158
|
+
sassLoader,
|
|
159
|
+
]
|
|
160
|
+
: [
|
|
161
|
+
opts.env.dev ? styleLoader : MiniCssExtractPlugin.loader,
|
|
162
|
+
cssLoader,
|
|
163
|
+
postCssLoader,
|
|
164
|
+
resolveUrlLoader,
|
|
165
|
+
sassLoader,
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
return config;
|
|
171
|
+
},
|
|
172
|
+
};
|
|
Binary file
|
package/jest-addons-loader.js
DELETED
package/jest-extender-plugin.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Extends the Volto test configuration by injecting the keys in `jest.config.js`
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const projectRootPath = path.resolve('.');
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
modifyJestConfig({
|
|
8
|
-
jestConfig: config,
|
|
9
|
-
webpackObject,
|
|
10
|
-
options: { razzleOptions, pluginOptions },
|
|
11
|
-
paths,
|
|
12
|
-
}) {
|
|
13
|
-
// If the RAZZLE_JEST_CONFIG env var exists,
|
|
14
|
-
// use it as the file with the Jest config overrides
|
|
15
|
-
if (process.env.RAZZLE_JEST_CONFIG) {
|
|
16
|
-
if (fs.existsSync(path.resolve(process.env.RAZZLE_JEST_CONFIG))) {
|
|
17
|
-
const jestConfigPath = path.resolve(process.env.RAZZLE_JEST_CONFIG);
|
|
18
|
-
const jestConfig = require(jestConfigPath);
|
|
19
|
-
config = { ...config, ...jestConfig };
|
|
20
|
-
return config;
|
|
21
|
-
}
|
|
22
|
-
if (
|
|
23
|
-
fs.existsSync(`${projectRootPath}/${process.env.RAZZLE_JEST_CONFIG}`)
|
|
24
|
-
) {
|
|
25
|
-
const jestConfig = require(
|
|
26
|
-
`${projectRootPath}/${process.env.RAZZLE_JEST_CONFIG}`,
|
|
27
|
-
);
|
|
28
|
-
config = { ...config, ...jestConfig };
|
|
29
|
-
}
|
|
30
|
-
// if not, use the sensible default, `jest.config.js`
|
|
31
|
-
} else {
|
|
32
|
-
if (fs.existsSync(`${projectRootPath}/jest.config.js`)) {
|
|
33
|
-
const jestConfig = require(`${projectRootPath}/jest.config.js`);
|
|
34
|
-
config = { ...config, ...jestConfig };
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return config;
|
|
38
|
-
},
|
|
39
|
-
};
|
package/jest-setup-afterenv.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
process(src, filename) {
|
|
5
|
-
if (filename.includes('src/icons')) {
|
|
6
|
-
return `module.exports = { attributes: { xmlns: '', viewBox: ''}}`;
|
|
7
|
-
}
|
|
8
|
-
return `module.exports = ${JSON.stringify(path.basename(filename))}`;
|
|
9
|
-
},
|
|
10
|
-
};
|
package/package-why.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"scripts": {
|
|
3
|
-
"postinstall": "Description for `npm run postinstall` command",
|
|
4
|
-
"analyze": "Description for `npm run analyze` command",
|
|
5
|
-
"start": "Description for `npm run start` command",
|
|
6
|
-
"build": "Description for `npm run build` command",
|
|
7
|
-
"build:clean": "Description for `npm run build:clean` command",
|
|
8
|
-
"dist:clean": "Description for `npm run dist:clean` command",
|
|
9
|
-
"build:dist": "Description for `npm run build:dist` command",
|
|
10
|
-
"test": "Description for `npm run test` command",
|
|
11
|
-
"test:ci": "Description for `npm run test:ci` command",
|
|
12
|
-
"test:husky": "Description for `npm run test:husky` command",
|
|
13
|
-
"test:debug": "Description for `npm run test:debug` command",
|
|
14
|
-
"start:prod": "Description for `npm run start:prod` command",
|
|
15
|
-
"start:dist": "Description for `npm run start:dist` command",
|
|
16
|
-
"prettier": "Description for `npm run prettier` command",
|
|
17
|
-
"prettier:fix": "Description for `npm run prettier:fix` command",
|
|
18
|
-
"stylelint": "Description for `npm run stylelint` command",
|
|
19
|
-
"stylelint:overrides": "Description for `npm run stylelint:overrides` command",
|
|
20
|
-
"stylelint:fix": "Description for `npm run stylelint:fix` command",
|
|
21
|
-
"lint": "Description for `npm run lint` command",
|
|
22
|
-
"lint:fix": "Description for `npm run lint:fix` command",
|
|
23
|
-
"i18n": "Description for `npm run i18n` command",
|
|
24
|
-
"i18n:ci": "Description for `npm run i18n:ci` command",
|
|
25
|
-
"stylelint:patches": "Description for `npm run stylelint:patches` command",
|
|
26
|
-
"patches": "Description for `npm run patches` command",
|
|
27
|
-
"dry-release": "Description for `npm run dry-release` command",
|
|
28
|
-
"release": "Description for `npm run release` command",
|
|
29
|
-
"release-major-alpha": "Description for `npm run release-major-alpha` command",
|
|
30
|
-
"release-alpha": "Description for `npm run release-alpha` command",
|
|
31
|
-
"storybook": "Description for `npm run storybook` command",
|
|
32
|
-
"build-storybook": "Description for `npm run build-storybook` command"
|
|
33
|
-
}
|
|
34
|
-
}
|
package/patches/patchit.sh
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
--- /Users/sneridagh/Development/plone/volto/node_modules/razzle/config/createJestConfig.js 2020-11-07 16:11:14.489360747 +0100
|
|
2
|
-
+++ /Users/sneridagh/Development/plone/volto/node_modules/razzle/config/createJestConfigNew.js 2020-11-07 16:13:44.816817775 +0100
|
|
3
|
-
@@ -84,6 +84,7 @@
|
|
4
|
-
'mapCoverage',
|
|
5
|
-
'moduleDirectories',
|
|
6
|
-
'moduleFileExtensions',
|
|
7
|
-
+ 'modulePathIgnorePatterns',
|
|
8
|
-
'moduleNameMapper',
|
|
9
|
-
'modulePaths',
|
|
10
|
-
'snapshotSerializers',
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { JSONSchema } from '@plone/types';
|
|
2
|
-
import type { Ref } from 'react';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
|
|
5
|
-
const cleanupSchema = (schema: JSONSchema | null): JSONSchema | null => {
|
|
6
|
-
if (!schema || !schema.properties) return schema;
|
|
7
|
-
return {
|
|
8
|
-
...schema,
|
|
9
|
-
properties: Object.entries(schema.properties).reduce<Record<string, any>>(
|
|
10
|
-
(acc, [key, value]) => {
|
|
11
|
-
acc[key] = {
|
|
12
|
-
...value,
|
|
13
|
-
description:
|
|
14
|
-
typeof value.description === 'string'
|
|
15
|
-
? value.description
|
|
16
|
-
: undefined,
|
|
17
|
-
};
|
|
18
|
-
return acc;
|
|
19
|
-
},
|
|
20
|
-
{},
|
|
21
|
-
),
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Field = vi.fn((props) => (
|
|
26
|
-
<div className="Field" id={props.id}>
|
|
27
|
-
{props.title}
|
|
28
|
-
</div>
|
|
29
|
-
));
|
|
30
|
-
|
|
31
|
-
export const InlineForm = vi.fn((props) => (
|
|
32
|
-
<div
|
|
33
|
-
id="InlineForm"
|
|
34
|
-
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
35
|
-
/>
|
|
36
|
-
));
|
|
37
|
-
|
|
38
|
-
export const ModalForm = vi.fn((props) => (
|
|
39
|
-
<div
|
|
40
|
-
id="ModalForm"
|
|
41
|
-
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
42
|
-
/>
|
|
43
|
-
));
|
|
44
|
-
|
|
45
|
-
export const UndoToolbar = vi.fn(() => <div id="UndoToolbar" />);
|
|
46
|
-
|
|
47
|
-
export const BlocksToolbar = vi.fn(() => <div id="BlocksToolbar" />);
|
|
48
|
-
|
|
49
|
-
export const BlockDataForm = vi.fn((props) => (
|
|
50
|
-
<div
|
|
51
|
-
id="BlockDataForm"
|
|
52
|
-
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
53
|
-
/>
|
|
54
|
-
));
|
|
55
|
-
|
|
56
|
-
export const BlocksForm = vi.fn((props) => (
|
|
57
|
-
<div
|
|
58
|
-
id="BlocksForm"
|
|
59
|
-
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
60
|
-
/>
|
|
61
|
-
));
|
|
62
|
-
|
|
63
|
-
const MockForm = forwardRef(
|
|
64
|
-
(props: { schema: JSONSchema | null }, ref: Ref<any>) => (
|
|
65
|
-
<div
|
|
66
|
-
id="Form"
|
|
67
|
-
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
68
|
-
ref={ref}
|
|
69
|
-
/>
|
|
70
|
-
),
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
export const Form = vi.fn((props) => <MockForm {...props} />);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Portal that wraps Sidebar components
|
|
7
|
-
* @param {React.ReactNode} children Sidebar content
|
|
8
|
-
* @param {bool} selected Sidebar needs to know when the related block is selected
|
|
9
|
-
* @param {string} tab Element id where to insert sidebar content, default: sidebar-properties
|
|
10
|
-
* @returns {string} Rendered sidebar
|
|
11
|
-
*/
|
|
12
|
-
const SidebarPortal = ({ children, selected, tab = 'sidebar-properties' }) => {
|
|
13
|
-
const [isClient, setIsClient] = React.useState(null);
|
|
14
|
-
|
|
15
|
-
React.useEffect(() => setIsClient(true), []);
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
{isClient &&
|
|
20
|
-
selected &&
|
|
21
|
-
createPortal(
|
|
22
|
-
<div role="form" style={{ height: '100%' }}>
|
|
23
|
-
<div
|
|
24
|
-
style={{ height: '100%' }}
|
|
25
|
-
role="presentation"
|
|
26
|
-
onClick={(e) => {
|
|
27
|
-
e.stopPropagation();
|
|
28
|
-
}}
|
|
29
|
-
onKeyDown={(e) => {
|
|
30
|
-
e.stopPropagation();
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</div>
|
|
35
|
-
</div>,
|
|
36
|
-
document.getElementById(tab),
|
|
37
|
-
)}
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
SidebarPortal.propTypes = {
|
|
43
|
-
children: PropTypes.any,
|
|
44
|
-
selected: PropTypes.bool.isRequired,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default SidebarPortal;
|