@plone/volto 16.0.0-rc.3 → 16.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/CHANGELOG.md +372 -1
- package/package.json +2 -1
- package/src/components/manage/Blocks/HeroImageLeft/Data.jsx +2 -1
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +1 -0
- package/src/components/manage/Blocks/Listing/ListingData.jsx +1 -0
- package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +1 -0
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +1 -0
- package/src/components/manage/Blocks/ToC/Edit.jsx +1 -0
- package/src/components/manage/Blocks/Video/VideoSidebar.jsx +1 -1
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +2 -2
- package/src/components/manage/Widgets/ObjectListWidget.jsx +19 -2
- package/src/config/Style.jsx +9 -0
- package/src/config/index.js +2 -0
- package/src/helpers/Blocks/Blocks.js +37 -38
- package/src/helpers/Blocks/Blocks.test.js +64 -0
- package/test-setup-config.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,383 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 16.1.0 (2022-11-23)
|
|
4
|
+
|
|
5
|
+
### Feature
|
|
6
|
+
|
|
7
|
+
- Support for drilled down current state and updater function from schema in `ObjectListWidget`. This allows to sync the current object selected from the UI and the block settings and viceversa @sneridagh
|
|
8
|
+
- Allow custom style wrapper classnames via fieldname suffixes. Added `config.settings.styleClassNameConverters` to register new suffix converters @tiberiuichim
|
|
9
|
+
|
|
10
|
+
### Bugfix
|
|
11
|
+
|
|
12
|
+
- Fix jest moduleNameMapper for `@plone/volto/babel` @tiberiuichim
|
|
13
|
+
- Fix addons loader test @tiberiuichim
|
|
14
|
+
- Pass down `onChangeBlock` prop to all stock blocks in core @sneridagh
|
|
15
|
+
- Fix user search by full name in users control panel @reebalazs
|
|
16
|
+
|
|
17
|
+
## 16.0.0 (2022-11-22)
|
|
18
|
+
|
|
19
|
+
### Breaking
|
|
20
|
+
|
|
21
|
+
- Deprecate NodeJS 12 since it's out of LTS since April 30, 2022 @sneridagh
|
|
22
|
+
- Move all cypress actions to the main `Makefile`, providing better meaningful names. Remove them from `package.json` script section. @sneridagh
|
|
23
|
+
- Remove `div` as default if `as` prop from `RenderBlocks`. Now the default is a `React.Fragment` instead. This could lead to CSS inconsistencies if taken this div into account, specially if used in custom add-ons without. In order to avoid them, set the `as` property always in your add-ons. @sneridagh
|
|
24
|
+
- Removed `date-fns` from dependencies, this was in the build because `Cypress` depended on it. After the `Cypress` upgrade it no longer depends on it. If your project still depends on it, add it as a dependency of your project. @sneridagh
|
|
25
|
+
- Removed all usage of `date-fns` from core. @sneridagh
|
|
26
|
+
- Rename `src/components/manage/Widgets/ColorPicker.jsx` component to `src/components/manage/Widgets/ColorPickerWidget.jsx` @sneridagh
|
|
27
|
+
- Remove the style wrapper around the `<Block />` component in Edit mode, moved to the main edit wrapper @sneridagh
|
|
28
|
+
- New `cloneDeepSchema` helper @sneridagh
|
|
29
|
+
- Action `listUsers`to be called with Object. Distinguish between search for id or search for fullname, email, username @ksuess
|
|
30
|
+
- Integrate volto-state add-on. @tiberiuichim @razvanmiu @eea
|
|
31
|
+
- Staticize Poppins font to be compliant with EU privacy. Import from GoogleFont is disabled in site.variables. @giuliaghisini
|
|
32
|
+
- Remove the `callout` button (the one with the megaphone icon) from the slate toolbar since it has the same styling as `blockquote`. If you need it anyway, you can bring it back in your addon. @sneridagh
|
|
33
|
+
- Using volto-slate Headline / Subheadline buttons strips all elements in the selection @tiberiuichim
|
|
34
|
+
- Use `Cypress` 10.3.0 (migrate from 9.x.x). Cypress 10 has some interesting goodies, being the native support of Apple Silicon Computers the main of it. See https://docs.voltocms.com/upgrade-guide/ for more information. @sneridagh
|
|
35
|
+
- The complete configuration registry is passed to the add-ons and the project configuration pipeline @sneridagh
|
|
36
|
+
- Refactor the component registry API in the configuration registry @sneridagh @tiberiuichim
|
|
37
|
+
- change password-reset url to be consistent with Plone configuration @erral
|
|
38
|
+
- Simplify over the existing Component Registry API. The `component` key has been flattened for simplification and now it's mapped directly to the `component` argument of `registerComponent`. @sneridagh
|
|
39
|
+
- This is an UI/UX breaking change. It changes the back button in folder contents from using a cross icon to using a back icon. The rationale behind is because the cross evoque "cancel" when what happens is a change of view. It's also consistent with both PastanagaUI and QuantaUI style guide. @robgietema
|
|
40
|
+
- Main workflow change menu changed from Pastanaga UI simplification to classic Plone implementation. @sneridagh
|
|
41
|
+
- Move Layout constants to `config.views.layoutViewsNamesMapping`. Complete the list. i18n the list. Improve Display component. @sneridagh
|
|
42
|
+
- `react-window` no longer a Volto dependency @sneridagh
|
|
43
|
+
- Upgrade to Razzle 4 @davisagli
|
|
44
|
+
- Jest downgraded from 27 to 26 @davisagli
|
|
45
|
+
- Sentry integration is now lazy-loaded. The `sentryOptions` key from the `settings` registry becomes a callable that passes resolved sentry libraries. @tiberiuichim
|
|
46
|
+
- Change history route name to `historyview` (same as classic) in order to allow content to have 'history' as `id` @danielamormocea
|
|
47
|
+
- The listing block icon has been improved to avoid confusions with the normal text list @sneridagh
|
|
48
|
+
- Remove the means to enable the StyleWrapper in favor of defining it through the block schema. @sneridagh
|
|
49
|
+
- Moved all sentry-related code from Volto to the `@plone-collective/volto-sentry` package. @tiberiuichim
|
|
50
|
+
- The listing block icon has been improved to avoid confusion with the normal text list. @sneridagh
|
|
51
|
+
- Restrict css selector for error message (volto-slate) #3838 @mamico
|
|
52
|
+
- Upgrade `husky` to latest version @sneridagh
|
|
53
|
+
- Enable the use of yarn 3 in the build by default @sneridagh
|
|
54
|
+
- The `ContentsBreadcrumbs` component now renders the whole language name of the language root folder (if any) instead of just the `id` (before: `de`, now: `Deutsch`) @sneridagh
|
|
55
|
+
|
|
56
|
+
See https://6.dev-docs.plone.org/volto/upgrade-guide/index.html for more information.
|
|
57
|
+
|
|
58
|
+
### Feature
|
|
59
|
+
|
|
60
|
+
- added default placeholder for videos to embed them more lightly @giuliaghisini
|
|
61
|
+
- Added new Block Style Wrapper. This implementation is marked as **experimental** during Volto 16 alpha period. The components, API and the styling are subject to change **without issuing a breaking change**. You can start using it in your projects and add-ons, but taking this into account. See documentation for more information. @sneridagh
|
|
62
|
+
- Add default widget views for all type of fields and improve the DefaultView @ionlizarazu
|
|
63
|
+
- added configurable identifier field for password reset in config.js. @giuliaghisini
|
|
64
|
+
- Add `expandToBackendURL` helper @sneridagh
|
|
65
|
+
- added 'show total results' option in Search block configuration. @giuliaghisini
|
|
66
|
+
- Added viewableInBrowserObjects setting to use in alternative to downloadableObjects, if you want to view file in browser intstead downloading. @giuliaghisini
|
|
67
|
+
- Disable already chosen criteria in querystring widget @kreafox
|
|
68
|
+
- Added X-Forwarded-\* headers to superagent requests. @mamico
|
|
69
|
+
- Updated Brazilian Portuguese translation @ericof
|
|
70
|
+
- Forward `HTTP Range` headers to the backend. @mamico
|
|
71
|
+
- Add default value to color picker, if `default` is present in the widget schema. @sneridagh
|
|
72
|
+
- Inject the classnames of the StyleWrapper into the main edit wrapper (it was wrapping directly the Edit component before). This way, the flexibility is bigger and you can act upon the whole edit container and artifacts (handlers, etc) @sneridagh
|
|
73
|
+
- Refactor image block: make it schema extensible @nileshgulia1 @sneridagh
|
|
74
|
+
- Add control panel via config.settings @ksuess https://github.com/plone/volto/issues/3426
|
|
75
|
+
- Add noindex metadata tag @steffenri
|
|
76
|
+
- Adding Schema for Maps Block in Sidebar @iRohitSingh
|
|
77
|
+
- Add a Pluggable to the sharing page @JeffersonBledsoe #3372
|
|
78
|
+
- Add listing variation schemaEnhancer to the search block schema @ionlizarazu
|
|
79
|
+
- Use the local blocksConfig for extensions, fallback to the config object one. This allows to override local blocks config in nested blocks (blocks in a block, eg. accordion, grid, row) @sneridagh
|
|
80
|
+
- Use type info instead of id type as icon title in the folder contents. @mamico
|
|
81
|
+
- Remove transifex configuration for Volto translations @erral
|
|
82
|
+
- Add missing support for inner `blocksConfig` in block extensions resolutions @sneridagh
|
|
83
|
+
- Add schema to video block sidebar @iRohitSingh @danielamormocea
|
|
84
|
+
- Add user group membership control panel @ksuess
|
|
85
|
+
- Action `listUsers`: Support search for fullname, email, username. @ksuess
|
|
86
|
+
- Added the `Undo controlpanel` to the controlpanels which can be used to undo transactions. @MdSahil-oss
|
|
87
|
+
- Send extra data coming from listing block schemaEnhancer from searchBlock to the listing variation @ionlizarazu
|
|
88
|
+
- support for many_users and many_groups flag in user controlpanel and group controlpanel @nileshgulia1
|
|
89
|
+
- Show the content type of the content object you are adding/editing in the sidebar @robgietema
|
|
90
|
+
- Remove soft hyphens from the title tag @davisagli
|
|
91
|
+
- handle 'no connection' available error (408 error). @giuliaghisini
|
|
92
|
+
- Add support for OpenStreet Maps in Maps block @sneridagh
|
|
93
|
+
- Make `internalApiPath` client aware, since there are some corner cases when the client needs to know it to properly handle API server URLs @sneridagh
|
|
94
|
+
- Add initialPath support to ObjectBrowser widget @robgietema
|
|
95
|
+
- Added placeholder param to widget, to change default placeholder @giuliaghisini
|
|
96
|
+
- Add clear formatting button to slate @robgietema
|
|
97
|
+
- Support for getting `selectableTypes` and `maximumSelectionSize` from `widgetProps` @sneridagh
|
|
98
|
+
- Added placeholder param to widget, to change default placeholder @giuliaghisini
|
|
99
|
+
- Add a headline (`headline` field) to the listing block schema by default @sneridagh
|
|
100
|
+
- Add scroll into view setting to slate @robgietema
|
|
101
|
+
- Use absolute dates instead of "x hours ago" in History view @steffenri
|
|
102
|
+
- Complete eu translation @erral
|
|
103
|
+
- Complete es translation. @erral
|
|
104
|
+
- Added new components `Aliases` for aliases control in Volto. Alias management in both controlpanel and object view. @andreiggr @avoinea
|
|
105
|
+
- Added resetOnCancel functionality in Form component @MdSahil-oss
|
|
106
|
+
- volto-slate: introduce style-menu @nileshgulia1
|
|
107
|
+
- Show result of the addon install/uninstall/upgrade actions @erral
|
|
108
|
+
- Working copy actions now render errors if they fail @pnicolli
|
|
109
|
+
- lazyloading of rrule lib. @giuliaghisini
|
|
110
|
+
- Complete eu translation. @erral
|
|
111
|
+
- Complete spanish translation @erral
|
|
112
|
+
- Added an option for users to set their own password through a confirmation email in the Add Users modal within the Users control panel. @JeffersonBledsoe #3710
|
|
113
|
+
- Accept a `querystring` object in `apiExpanders` config object settings @sneridagh
|
|
114
|
+
- Add a dynamic user form based in @userschema endpoint @erral @nileshgulia1
|
|
115
|
+
- Send missing variation data to the listing variation @ionlizarazu
|
|
116
|
+
- Logout action in personal tools points to the same pathname, now it logout in place, not in the root. @sneridagh
|
|
117
|
+
- Object browser: image search should only show images @reebalazs
|
|
118
|
+
- Updated spanish translation @macagua
|
|
119
|
+
- Add Dutch translation @spereverde
|
|
120
|
+
- Added link integrity potential breakage warning message when deleting a referenced page @danielamormocea
|
|
121
|
+
- Added new components & interfaces for content-rules `Rules` control in Volto. Rules management in both controlpanel and object view. @andreiggr
|
|
122
|
+
- Updated Spanish translation @macagua
|
|
123
|
+
- Introduce `TextLineEdit` component @sneridagh
|
|
124
|
+
- Add a popup tooltip for tokenized options in Select widget values @sneridagh
|
|
125
|
+
- Add `image-narrow` svg icon useful for align widget actions @ichim-david
|
|
126
|
+
- Use `View comments` and `Reply to item` permissions in `Comments` component. @razvanMiu
|
|
127
|
+
- Added portrait middleware adapter. @instification
|
|
128
|
+
- Allow dumping the addon dependency graph to a .dot file. Start Volto with `DEBUG_ADDONS_LOADER=true yarn start`, `addon-dependency-graph.dot` will be created in your project folder. @tiberiuichim
|
|
129
|
+
- Add clear button in search field of Folder content view @iFlameing
|
|
130
|
+
- consume site_actions from restapi @nileshgulia1
|
|
131
|
+
- Updated Spanish translation @macagua
|
|
132
|
+
- Japanese translation updated @terapyon
|
|
133
|
+
- Improve the `AlignWidget`, add `narrow` fix default support @sneridagh
|
|
134
|
+
- Add support for loading core add-ons from the `packages` folder defined in Volto's `package.json` @sneridagh
|
|
135
|
+
- Implement the Upgrade Control Panel @ericof
|
|
136
|
+
- Allow addons to customize modules from the project root, via the `@root` namespace and folder @tiberiuichim
|
|
137
|
+
- Brazilian Portuguese translation updated @ericof
|
|
138
|
+
- Improvement of the `ContentsBreadcrumbs` component, add child `ContentsBreadcrumbsRootItem` and `ContentsBreadcrumbsHomeItem` for easy customization of these single elements in projects @sneridagh
|
|
139
|
+
- Add german translation for group membership panel. @ksuess
|
|
140
|
+
- Fix general german translations: Address user polite. Correct 'listing template' to 'listing variant'. Add missing translations. @ksuess
|
|
141
|
+
- Allow passing ariaHidden, id and style to an Icon's SVG @JeffersonBledsoe #3908
|
|
142
|
+
- All Fields now understand the `default` prop as a fallback value in case their data value is missing. As a convenience, the `defaultValue` is also used as a fallback, but this shouldn't proliferate. @tiberiuichim
|
|
143
|
+
- There is an experimental setting to move the button for adding a new block to show below any selected block, instead of only on the left of empty text blocks. Set `config.experimental.addBlockButton.enabled = true` to enable it. @davisagli
|
|
144
|
+
|
|
145
|
+
### Bugfix
|
|
146
|
+
|
|
147
|
+
- Fix Search page visit crashes /contents view @dobri1408
|
|
148
|
+
- Fix sidebar full size bottom opacity on edit page when sidebar is collapsed @ichim-david
|
|
149
|
+
- Fix toolbar bottom opacity on edit page when toolbar is collapsed @ichim-david
|
|
150
|
+
- Fix content view regression, height issue @danielamormocea
|
|
151
|
+
- Fixed secure cookie option. @giuliaghisini
|
|
152
|
+
- Changed addon order in addon controlpanel to mimic Classic UI @erral
|
|
153
|
+
- Fixed error when loading content in a language for which a Volto translation is not available. @davisagli
|
|
154
|
+
- Fix for clipped dropdown menus when the table has few or no records in Contents view @mihaislobozeanu
|
|
155
|
+
- fixed view video list from youtube in Video block. @giuliaghisini
|
|
156
|
+
- Fixed ICS URL in event view in seamless mode @sneridagh
|
|
157
|
+
- Fix `withStylingSchemaEnhancer` enhancer mechanism @sneridagh
|
|
158
|
+
- Add correct query parameters to the redirect @robgietema
|
|
159
|
+
- Fix RenderBlocks: path @ksuess
|
|
160
|
+
- Fix field id creation in dexterity control panel to have slugified id @erral
|
|
161
|
+
- Changed to get intl.locale always from state @ionlizarazu
|
|
162
|
+
- Fix regression, compound lang names (eg. `pt-BR`) no longer working @sneridagh
|
|
163
|
+
- fix TokenWidget choices when editing a recently created content. @giuliaghisini
|
|
164
|
+
- Fix color picker defaults implementation #2 @sneridagh
|
|
165
|
+
- Enable default color in `backgroundColor` default StyleWrapper field which wasn't sync with the default value setting @sneridagh
|
|
166
|
+
- Fix Block style wrapper: Cannot read properties of undefined (reading 'toString') @avoinea #3410
|
|
167
|
+
- fix schema when content contains lock informations. @giuliaghisini
|
|
168
|
+
- Don't render junk when no facets are added to the search block @tiberiuichim
|
|
169
|
+
- Fix visibility of toolbar workflow dropdown for more states as fitting in .toolbar-content. @ksuess
|
|
170
|
+
- Fix the video block for anonymous user @iFlameing
|
|
171
|
+
- Use `cloneDeepSchema` helper for schema cloning operations, this fixes the error thrown in the use case of having JSX in the schema while cloning schema operations @sneridagh
|
|
172
|
+
- Fix CSS bundling in production mode to be consistent with the current policy in the client bundle. Right now the order of the CSS resources matches this chain: Loading of `import my-less.less` in add-ons (following the add-on order) -> Loading of the Semantic UI defaults -> Loading of the local theme (either project or add-on based). We are forcing now the bundling of all the CSS in one chunk, so it behaves the same than in dev mode (using the style-loader). @sneridagh
|
|
173
|
+
- Fixed the description field not being included in the navigation action/ reducer @JeffersonBledsoe #3454
|
|
174
|
+
- Fixed a11y of Maps block (#3467) @iRohitSingh
|
|
175
|
+
- Prevent the `defaultView` to show anything if the content is not loaded yet. This fixes showing the non-blocks enabled view for a fraction of a second before showing the blocks-enabled one once the content is loaded. @sneridagh
|
|
176
|
+
- Fix typo in de locale @wolbernd
|
|
177
|
+
- Add some more messages to be able to translate them @erral
|
|
178
|
+
- Fix typo in de locale @wolbernd
|
|
179
|
+
- [generator] Improvements to the addon generator: Now it wires up the addon automatically for immediate local development @sneridagh
|
|
180
|
+
- complete eu translation @erral
|
|
181
|
+
- complete es translation @erral
|
|
182
|
+
- [generator] Add .editorconfig and .prettierignore to generated projects and addons. @ericof
|
|
183
|
+
- Make `crypto-random-string` a direct dep, fixing a hidden error since some updated dependency was requiring it directly but not anymore. @sneridagh
|
|
184
|
+
- Fix edge cases in Cypress flaky tests when the Edit component was loaded without loading the type schema. @sneridagh & @davisagli
|
|
185
|
+
- Fix edge cases in Cypress flaky tests when the Edit component was loaded for the wrong content path. @davisagli
|
|
186
|
+
- complete pt_BR translation @ericof
|
|
187
|
+
- Fix action `listUsers`. Provide default. @ksuess
|
|
188
|
+
- Provide the correct id to the blocks wrapped by StyleWrapper. @razvanMiu
|
|
189
|
+
- Remove console deprecation notice for 'host' property usage coming from Express @sneridagh
|
|
190
|
+
- Make Search page title translatable @erral
|
|
191
|
+
- Changed storeProtectLoadUtils location from src/storeProtectLoadUtils to src/middleware/storeProtectLoadUtils @MdSahil-oss
|
|
192
|
+
- Fix ArrayWidget choices when editing a recently created content item. @davisagli
|
|
193
|
+
- Fix content loading in `DefaultView` infinite loop if a listing block with no query is present. @sneridagh
|
|
194
|
+
- Fix login form redirect when it was loaded with a trailing slash @davisagli
|
|
195
|
+
- Better de translation for Site Setup @davisagli
|
|
196
|
+
- Fix overlapping for long words in Control Panel titles (added word-wrapping) @sneridagh
|
|
197
|
+
- Fix sitemap.xml.gz @robgietema
|
|
198
|
+
- Fix Image gallery listing block variation only gets 25 if no query is set @sneridagh
|
|
199
|
+
- Fix array widget translation @robgietema
|
|
200
|
+
- Fix: TTW DX Layout disables IBlocks behavior and with it all the indexers and transformers @avoinea
|
|
201
|
+
- Fix: Slate Editor: can not delete bullet point after adding it by typing "- " #3597 @dobri1408
|
|
202
|
+
- Fix literal for the listing block edit mode message telling if the results are contained items (no query) or query results ones (query present) @sneridagh
|
|
203
|
+
- Fix grouping of the "users and groups" control panels (plone-users category) @sneridagh
|
|
204
|
+
- Improve `Display` and `Workflow` widgets in `More` menu. Fix alignments. @sneridagh
|
|
205
|
+
- Fixed searching in the sharing page not showing any results @JeffersonBledsoe #3579
|
|
206
|
+
- Fix types menu on mobile for many types. Specific menuStyle for 'more' menu. @ksuess
|
|
207
|
+
- Fix types menu on desktop when menu overflows the viewport, adding scroll to it @sneridagh
|
|
208
|
+
- Fix "cannot have two html5 backends at the same time" error @davisagli
|
|
209
|
+
- Reset filter in folder contents when navigating @robgietema
|
|
210
|
+
- Fix bug showing incorrect history after a revert action @robgietema
|
|
211
|
+
- Fix and edge case, in case a `RelationList` has no default, on empty fields, after the object has been created, it saves an empty (None/null) value. Make sure that internally, if that's the case, it's an empty array always. @sneridagh
|
|
212
|
+
- Fix workflow and display select in toolbar in case that the option spans several lines @sneridagh
|
|
213
|
+
- Fix Press Enter in some blocks does not focus on the text block below #3647 @dobri1408
|
|
214
|
+
- Add `matchAllRoutes` to AsyncConnect so that it matches all configured `asyncPropsExtenders` @tiberiuichim
|
|
215
|
+
- Fix acceptence test groups controlpanel @ksuess
|
|
216
|
+
- Fix the typo in change workflow status dialog in "de" @iRohitSingh
|
|
217
|
+
- Fix selection error when pressing backspace @robgietema
|
|
218
|
+
- Fix sidebarTab in Toc Block @iRohitSingh
|
|
219
|
+
- Fix virtualization (windowing) when displaying options with long titles for select widgets. (The virtualization happen when the number of options is greater than 25). Add dynamic height aware options using `react-virtualized`. @sneridagh
|
|
220
|
+
- Fix email validation to ensure all addresses are correctly validated @instification
|
|
221
|
+
- Fix number widget when the value is 0 @iRohitSingh
|
|
222
|
+
- Fix the typo in change workflow status dialog in "de" @iRohitSingh
|
|
223
|
+
- Show unauthorized message when accessing the diff view without permission @robgietema
|
|
224
|
+
- Fix i18n in title of Aliases control panel @sneridagh
|
|
225
|
+
- The styling schema is now applied before the block variations schema enhancers, to allow those enhancers a chance to tweak the styling schema @tiberiuichim
|
|
226
|
+
- Fix avatar URL in `PersonalTools`. Now works with the new `portrait` endpoint @sneridagh
|
|
227
|
+
- Fix `listing` block in SSR, now that it is fully variations aware and the configuration is passed to the SSR `querystring` action. @sneridagh
|
|
228
|
+
- Remove wrapping ul or ol when deselecting list style @robgietema
|
|
229
|
+
- Fix call to `@plone/scripts/i18n` (now a commonJS module) @sneridagh
|
|
230
|
+
- Concatenate multilingualRoutes and externalRoutes (if available) to defaultRoutes @erral #3653
|
|
231
|
+
- Fixed the `description` field not appearing in control panel fieldsets @JeffersonBledsoe #3696
|
|
232
|
+
- Fixed "more" always show root contents @MdSahil-oss #3365
|
|
233
|
+
- Add missing `--noninteractive` in the `build` script in package.json @sneridagh
|
|
234
|
+
- Fix replace `<a>` anchor element with the `UniversalLink` component in `DefaultTemplate.jsx` @Dnouv
|
|
235
|
+
- Extend Id widget validation rules to accept a dot "." @reebalazs
|
|
236
|
+
- Fix history page error for unauthenticated @reebalazs
|
|
237
|
+
- Fix unlock after changing the id and saving a page @reebalazs
|
|
238
|
+
- Group routes so React does not see them as a different Route and triggers a full remount. This is specially important in `Contents` @sneridagh
|
|
239
|
+
- Add default to `null` for `token` prop in `Navigation` component. This prevents the component to shoot an extra call when the logout happens @sneridagh
|
|
240
|
+
- Fix a double slash present in the `PersonalTools` component @sneridagh
|
|
241
|
+
- Fix UniversalLink storybook @tiberiuichim
|
|
242
|
+
- Fix logout to stay on the same page where the user was @reebalazs
|
|
243
|
+
- Change sentry chunk name to avoid ad blockers. Only load sentry if env vars exist @tiberiuichim
|
|
244
|
+
- SearchTags uses invalid vocabulary API @silviubogan
|
|
245
|
+
- Fix autocomplete widget with an empty search result @reebalazs
|
|
246
|
+
- Make sure that the store is reset on history reducer `PENDING` state @sneridagh
|
|
247
|
+
- Prefer views assigned explicitly with `layout` over views based on the `@type` @iRohitSingh
|
|
248
|
+
- Fix `schemaEnhancer` not being applied if nested `blocksConfig` is present @sneridagh
|
|
249
|
+
- Ensure the view component is always replaced after navigating to a different page. @davisagli
|
|
250
|
+
- Be more robust towards invalid block configuration @reebalazs
|
|
251
|
+
- Remove slate's builtin undo support, as it conflicts with Volto's undo manager. This fixes crashes when undoing in text blocks and slate's undo stack is empty and "crosses" into Volto's undo stack. This is a temporary workaround, ideally the two undo managers would be delimited so they each work together. @tiberiuichim
|
|
252
|
+
- Fix highlighting of selection when the Slate editor is not DOM-focused. @tiberiuichim
|
|
253
|
+
- Improve the algorithm that calculates the position of the Slate Toolbar @tiberiuichim
|
|
254
|
+
- The `_unwrapElement` of the volto-slate `ElementEditor` will return an updated range (selection) of the unwrapped element. @tiberiuichim
|
|
255
|
+
- Replace the main client entry point in `start-client.jsx` anonymous function for a named one. @sneridagh
|
|
256
|
+
- Fix `currentPath` option for `openObjectBrowser`. @iFlameing
|
|
257
|
+
- Fix updating the listing block when the variation is changed while editing @tiberiuichim
|
|
258
|
+
- fix(warning): StyleMenu dropdown item to use data-attr instead of custom @nileshgulia1
|
|
259
|
+
- Added --canary flag in plone/install.sh. @MdSahil-oss
|
|
260
|
+
- Fix condition in `applySchemaDefaults` @tiberiuichim @sneridagh
|
|
261
|
+
- Load core add-ons configuration as any other add-on. @sneridagh
|
|
262
|
+
- Fix `FormValidation` error object, use field `id` instead of field `title` @sneridagh
|
|
263
|
+
- Revert #2828 PR change of the default `showSearchButton` Search block behavior (see [#3883](https://github.com/plone/volto/issues/3883)) @sneridagh
|
|
264
|
+
- Fix `package.json` `postinstall` in core @sneridagh
|
|
265
|
+
- Hide control panel settings that are not relevant to Volto @danalvrz
|
|
266
|
+
- Hide not relevant for Volto control panels from site setup, further refine not used inner settings for site control panel @sneridagh
|
|
267
|
+
- Fix ObjectWidget handling of `default` values coming from schemas. @tiberiuichim
|
|
268
|
+
- Overhaul how block defaults are computed. See https://github.com/plone/volto/pull/3925 for more details @tiberiuichim
|
|
269
|
+
- Fix image tag for Plone 5.2.x, use 5.2.9 for now @sneridagh
|
|
270
|
+
- Cover an additional edge case for defaults @tiberiuichim
|
|
271
|
+
- Fix issue when using list markdown when list is already active (volto-slate) @robgietema
|
|
272
|
+
- Fix translation spelling of toggle @iFlameing
|
|
273
|
+
- Fix keyboard accessibility issue of Clear button in Folder content view @iFlameing
|
|
274
|
+
|
|
275
|
+
### Internal
|
|
276
|
+
|
|
277
|
+
- Improve Cypress integration, using Cypress official Github Action. Improve some flaky tests that showed up, and were known as problematic. Refactor and rename all the Github actions giving them meaningful names, and group them by type. Enable Cypress Dashboard for Volto. @sneridagh
|
|
278
|
+
- Stop using `xmlrpc` library for issuing the setup/teardown in core, use a `cy.request` instead. @sneridagh
|
|
279
|
+
- Added Cypress environment variables for adjusting the backend URL of commands @JeffersonBledsoe #3271
|
|
280
|
+
- Reintroduce Plone 6 acceptance tests using the latests `plone.app.robotframework` 2.0.0a6 specific Volto fixture. @datakurre @ericof @sneridagh
|
|
281
|
+
- Upgrade all tests to use `plone.app.robotframework` 2.0.0a6 @sneridagh
|
|
282
|
+
- Upgrade Sentry to latest version because of [#3346](https://github.com/plone/volto/issues/3346) @sneridagh
|
|
283
|
+
- Update `Cypress` to version 9.6.1 @sneridagh
|
|
284
|
+
- Missing change from the last breaking change (Remove the style wrapper around the `<Block />` component in Edit mode, moved to the main edit wrapper). Now, really move it to the main edit wrapper @sneridagh
|
|
285
|
+
- Fix warning because missing key in `VersionOverview` component @sneridagh
|
|
286
|
+
- Mock all loadable libraries. @mamico
|
|
287
|
+
- Update json-schema including transitive dependencies @davisagli
|
|
288
|
+
- Update release-it @davisagli
|
|
289
|
+
- Deduplicate dependencies using yarn-deduplicate @davisagli
|
|
290
|
+
- Fix `defaultBlockType` entry in default config, set it to slate. @sneridagh
|
|
291
|
+
- Allow passing `allowedChildren` option to the BlockButton, to strip elements in headlines @tiberiuichim
|
|
292
|
+
- Upgrade to latest `@plone/scripts` @sneridagh
|
|
293
|
+
- Update browserlist definitions @sneridagh
|
|
294
|
+
- Fix propTypes for Pagination component @davisagli
|
|
295
|
+
- Test against Plone 5.2.9 and 6.0.0b1 @davisagli
|
|
296
|
+
- Use latest 1.6.0 `@plone/scripts` @sneridagh
|
|
297
|
+
- Add classname of variation in edit mode @iFlameing
|
|
298
|
+
- Use component registry for default image, fallback to the local import @sneridagh
|
|
299
|
+
- Remove Razzle as direct dependency from @plone/scripts @sneridagh
|
|
300
|
+
- Fix storybook build for Razzle 4 @sneridagh
|
|
301
|
+
- Update `@plone/scripts` to 2.1.1 @sneridagh
|
|
302
|
+
- Run yarn deduplicate on dependencies. @davisagli
|
|
303
|
+
- Comment out flaky test for now regarding many users/groups @sneridagh
|
|
304
|
+
- Add reverse proxy conf with `traefik` to demo compose file @sneridagh
|
|
305
|
+
- More disable flaky test regarding many users/groups @sneridagh
|
|
306
|
+
- Remove no longer present option in cypress github action, by default, headless is true @sneridagh
|
|
307
|
+
- Add proper webserver with reverse proxy with seamless mode @sneridagh
|
|
308
|
+
- Update to Plone 6 beta3 @sneridagh
|
|
309
|
+
- Upgrade Cypress to latest @sneridagh
|
|
310
|
+
- Upgrade dependency rrule (optional dependency luxon removed) @ksuess
|
|
311
|
+
- Set `.nvmrc` to not use `lts/*` but a specific one `lts/gallium`
|
|
312
|
+
- Update to @plone/scripts 2.1.2 @sneridagh
|
|
313
|
+
- Remove all the useless security bits from blocks configuration definitions @sneridagh
|
|
314
|
+
- Add translation for `pending` state @iFlameing
|
|
315
|
+
- Add `composeSchema`, a helper to compose multiple schemaEnhancers @tiberiuichim
|
|
316
|
+
- Upgrade to `plone.voltoa14` @sneridagh
|
|
317
|
+
- Upgrade dependencies to latest released slate libraries. Make sure to pass down `ref` to rendered slate elements, as ref is now a function @tiberiuichim
|
|
318
|
+
- Add `editableProps` prop to the `SlateEditor` component, to pass down props to the base Slate `Editable` component. @tiberiuichim
|
|
319
|
+
- Clean, re-enable block-slate-format-link Cypress tests @tiberiuichim
|
|
320
|
+
- Rewrite some anonymous functions as named functions, to remove warning about Hot Reloading. @tiberiuichim
|
|
321
|
+
- Add translation for objectlist `Add` text @iFlameing
|
|
322
|
+
- Add translations for facet widget value @iFlameing
|
|
323
|
+
- Ignore `.tool-versions` file
|
|
324
|
+
- Minor updates to dependencies
|
|
325
|
+
- Update Cypress 11 @sneridagh
|
|
326
|
+
- Update to Plone 6 RC1 @sneridagh
|
|
327
|
+
|
|
328
|
+
### Documentation
|
|
329
|
+
|
|
330
|
+
- Move Cypress documentation from `README.md` to the docs. Improve the docs with the new `Makefile` commands.
|
|
331
|
+
- Improve English grammar and syntax in backend docs. @stevepiercy
|
|
332
|
+
- Fix JSX syntax highlighting. Remove duplicate heading. @stevepiercy
|
|
333
|
+
- fix make task `docs-linkcheckbroken` if grep has exit code 1 (no lines found)
|
|
334
|
+
- Updated simple.md @MdSahil-oss
|
|
335
|
+
- Fix indentation in nginx configuration in simple.md @stevepiercy
|
|
336
|
+
- Remove sphinx_sitemap configuration because Volto's docs are now imported into the main docs, making this setting unnecessary. @stevepiercy
|
|
337
|
+
- Set the ogp_site_url to main docs, instead of training. @stevepiercy
|
|
338
|
+
- `aria-*` attributes are now parsed correctly by jsx-lexer 2.0. @stevepiercy
|
|
339
|
+
- volto-slate documentation @nileshgulia1
|
|
340
|
+
- Fix redirect on YouTube, broken link after merge and deleted branch. @stevepiercy
|
|
341
|
+
- Add upgrade guide documentation for dealing with `volto-slate` upgrades for Volto 16 alpha 15 onwards. @sneridagh
|
|
342
|
+
- Minor clean up of volto-slate upgrade guide. @stevepiercy
|
|
343
|
+
- Rework documentation on how to write a Slate plugin @ksuess
|
|
344
|
+
- Documentation of the new component registry API @sneridagh
|
|
345
|
+
- Fix copy / paste text in list @robgietema
|
|
346
|
+
- Make links relative to `_static` so that `plone/documentation` can pull them in, and fix broken link. @stevepiercy
|
|
347
|
+
- Align `html_static_path` with `plone/documentation` and image path so that images render when docs build in both repos. @stevepiercy
|
|
348
|
+
- Undo html_static_path configuration in `plone/documentation`, and restore image and its referenced path in `plone/volto`. @stevepiercy
|
|
349
|
+
- Clean up "design principles" and "contributing"
|
|
350
|
+
- Bring back "Guidelines for Contributing"
|
|
351
|
+
- Fix Sphinx warning `WARNING: glossary terms must not be separated by empty lines` by closing unclosed glossary directive's triple backticks. @stevepiercy
|
|
352
|
+
- Fix broken links to nvm releases. @stevepiercy
|
|
353
|
+
- Ignore redirect that requires login to GitHub. @stevepiercy
|
|
354
|
+
- Added controls for the `actions` property of the `AlignWidget` storybook @JeffersonBledsoe #3671
|
|
355
|
+
- Generic Setup -> `GenericSetup`. @stevepiercy
|
|
356
|
+
- Upgrade to Plone 6 beta 2 @sneridagh
|
|
357
|
+
- Flip testing matrix for acceptance tests, make Plone 6 principal subject, Plone 5 as secondary @sneridagh
|
|
358
|
+
- Update README with latest versions, point to Plone 6 as recommended default @sneridagh
|
|
359
|
+
- Trigger a new deploy core Plone documentation when Volto documentation is updated @esteele
|
|
360
|
+
- Update supported Python versions. @stevepiercy
|
|
361
|
+
- Add NodeJS 18 (LTS) usage notice @sneridagh
|
|
362
|
+
- Fix Netlify build @sneridagh
|
|
363
|
+
- Fix grammar in Theming Strategy. Fixes #954. @stevepiercy
|
|
364
|
+
- Fix wording in About Semantic UI. Fixes #953. @stevepiercy
|
|
365
|
+
- Add missing pieces of the upgrade to use yarn 3 for projects @sneridagh
|
|
366
|
+
- Complete docs about the yarn 3 upgrade @sneridagh
|
|
367
|
+
- Add additional components to storybook @danalvrz
|
|
368
|
+
- Add `@plone/scripts` as a mandatory devDependency for projects to the upgrade guide @sneridagh
|
|
369
|
+
- Document `Sentry` integration move from Volto core to add-on `@plone-collective/volto-sentry` in configuration, upgrade and deployment. @ksuess
|
|
370
|
+
- Remove `sentryOptions` from settings reference. Clean up `deploying/sentry.md`. @stevepiercy
|
|
371
|
+
- Tidy up `upgrade-guide/index.md`. @stevepiercy
|
|
372
|
+
- Fix some MyST syntax and English grammar. @stevepiercy
|
|
373
|
+
|
|
3
374
|
## 16.0.0-rc.3 (2022-11-22)
|
|
4
375
|
|
|
5
376
|
### Bugfix
|
|
6
377
|
|
|
7
378
|
- Fix keyboard accessibility issue of Clear button in Folder content view @iFlameing
|
|
8
379
|
- Fix issue when using list markdown when list is already active (volto-slate) @robgietema
|
|
9
|
-
- Fix translation spelling of toggle
|
|
380
|
+
- Fix translation spelling of toggle @iFlameing
|
|
10
381
|
|
|
11
382
|
### Documentation
|
|
12
383
|
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "16.
|
|
12
|
+
"version": "16.1.0",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"moduleNameMapper": {
|
|
87
87
|
"@plone/volto/package.json": "<rootDir>/package.json",
|
|
88
|
+
"@plone/volto/babel": "<rootDir>/babel.js",
|
|
88
89
|
"@plone/volto/(.*)$": "<rootDir>/src/$1",
|
|
89
90
|
"@plone/volto-slate": "<rootDir>/packages/volto-slate/src",
|
|
90
91
|
"~/config": "<rootDir>/src/config",
|
|
@@ -9,7 +9,6 @@ const HeroImageLeftBlockData = (props) => {
|
|
|
9
9
|
const schema = schemaHero({ ...props, intl });
|
|
10
10
|
return (
|
|
11
11
|
<BlockDataForm
|
|
12
|
-
block={block}
|
|
13
12
|
schema={schema}
|
|
14
13
|
title={schema.title}
|
|
15
14
|
onChangeField={(id, value) => {
|
|
@@ -18,7 +17,9 @@ const HeroImageLeftBlockData = (props) => {
|
|
|
18
17
|
[id]: value,
|
|
19
18
|
});
|
|
20
19
|
}}
|
|
20
|
+
onChangeBlock={onChangeBlock}
|
|
21
21
|
formData={data}
|
|
22
|
+
block={block}
|
|
22
23
|
/>
|
|
23
24
|
);
|
|
24
25
|
};
|
|
@@ -140,7 +140,7 @@ class UsersControlpanel extends Component {
|
|
|
140
140
|
(this.props.createRequest.loading && nextProps.createRequest.loaded)
|
|
141
141
|
) {
|
|
142
142
|
this.props.listUsers({
|
|
143
|
-
|
|
143
|
+
search: this.state.search,
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
if (this.props.createRequest.loading && nextProps.createRequest.loaded) {
|
|
@@ -172,7 +172,7 @@ class UsersControlpanel extends Component {
|
|
|
172
172
|
onSearch(event) {
|
|
173
173
|
event.preventDefault();
|
|
174
174
|
this.props.listUsers({
|
|
175
|
-
|
|
175
|
+
search: this.state.search,
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -57,7 +57,9 @@ const messages = defineMessages({
|
|
|
57
57
|
* }
|
|
58
58
|
* mutated.fieldsets[0].fields.push('extraField');
|
|
59
59
|
* return mutated;
|
|
60
|
-
* }
|
|
60
|
+
* },
|
|
61
|
+
* activeObject: 0, // Current active object drilled down from the schema (if present)
|
|
62
|
+
* setActiveObject: () => {} // The current active object state updater function drilled down from the schema (if present)
|
|
61
63
|
* },
|
|
62
64
|
* ```
|
|
63
65
|
*/
|
|
@@ -71,7 +73,22 @@ const ObjectListWidget = (props) => {
|
|
|
71
73
|
onChange,
|
|
72
74
|
schemaExtender,
|
|
73
75
|
} = props;
|
|
74
|
-
const [
|
|
76
|
+
const [localActiveObject, setLocalActiveObject] = React.useState(
|
|
77
|
+
props.activeObject ?? value.length - 1,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
let activeObject, setActiveObject;
|
|
81
|
+
if (
|
|
82
|
+
(props.activeObject || props.activeObject === 0) &&
|
|
83
|
+
props.setActiveObject
|
|
84
|
+
) {
|
|
85
|
+
activeObject = props.activeObject;
|
|
86
|
+
setActiveObject = props.setActiveObject;
|
|
87
|
+
} else {
|
|
88
|
+
activeObject = localActiveObject;
|
|
89
|
+
setActiveObject = setLocalActiveObject;
|
|
90
|
+
}
|
|
91
|
+
|
|
75
92
|
const intl = useIntl();
|
|
76
93
|
|
|
77
94
|
function handleChangeActiveObject(e, blockProps) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const styleClassNameConverters = {
|
|
2
|
+
default: (name, value, prefix = '') => {
|
|
3
|
+
return value
|
|
4
|
+
? `has--${prefix}${name}--${(value || '').toString().replace(/^#/, '')}`
|
|
5
|
+
: null;
|
|
6
|
+
},
|
|
7
|
+
noprefix: (name, value) => value,
|
|
8
|
+
bool: (name, value) => (value ? name : ''),
|
|
9
|
+
};
|
package/src/config/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { loadables } from './Loadables';
|
|
|
24
24
|
import { workflowMapping } from './Workflows';
|
|
25
25
|
|
|
26
26
|
import { contentIcons } from './ContentIcons';
|
|
27
|
+
import { styleClassNameConverters } from './Style';
|
|
27
28
|
import {
|
|
28
29
|
controlPanelsIcons,
|
|
29
30
|
filterControlPanels,
|
|
@@ -167,6 +168,7 @@ let config = {
|
|
|
167
168
|
addonsInfo: addonsInfo,
|
|
168
169
|
workflowMapping,
|
|
169
170
|
errorHandlers: [], // callables for unhandled errors
|
|
171
|
+
styleClassNameConverters,
|
|
170
172
|
},
|
|
171
173
|
experimental: {
|
|
172
174
|
addBlockButton: {
|
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
* @module helpers/Blocks
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
omit,
|
|
8
|
-
without,
|
|
9
|
-
endsWith,
|
|
10
|
-
find,
|
|
11
|
-
isObject,
|
|
12
|
-
keys,
|
|
13
|
-
toPairs,
|
|
14
|
-
merge,
|
|
15
|
-
} from 'lodash';
|
|
6
|
+
import { omit, without, endsWith, find, isObject, keys, merge } from 'lodash';
|
|
16
7
|
import move from 'lodash-move';
|
|
17
8
|
import { v4 as uuid } from 'uuid';
|
|
18
9
|
import config from '@plone/volto/registry';
|
|
@@ -450,35 +441,43 @@ export function applyBlockDefaults({ data, intl, ...rest }, blocksConfig) {
|
|
|
450
441
|
return applySchemaDefaults({ data, schema, intl });
|
|
451
442
|
}
|
|
452
443
|
|
|
453
|
-
|
|
454
|
-
|
|
444
|
+
/**
|
|
445
|
+
* Converts a name+value style pair (ex: color/red) to a classname,
|
|
446
|
+
* such as "has--color--red"
|
|
447
|
+
*
|
|
448
|
+
* This can be expanded via the style names, by suffixing them with special
|
|
449
|
+
* converters. See config.settings.styleClassNameConverters. Examples:
|
|
450
|
+
*
|
|
451
|
+
* styleToClassName('theme:noprefix', 'primary') returns "primary"
|
|
452
|
+
* styleToClassName('inverted:bool', true) returns 'inverted'
|
|
453
|
+
* styleToClassName('inverted:bool', false) returns ''
|
|
454
|
+
*/
|
|
455
|
+
export const styleToClassName = (key, value, prefix = '') => {
|
|
456
|
+
const converters = config.settings.styleClassNameConverters;
|
|
457
|
+
const [name, ...convIds] = key.split(':');
|
|
458
|
+
|
|
459
|
+
return (convIds.length ? convIds : ['default'])
|
|
460
|
+
.map((id) => converters[id])
|
|
461
|
+
.reduce((acc, conv) => conv(acc, value, prefix), name);
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export const buildStyleClassNamesFromData = (obj = {}, prefix = '') => {
|
|
465
|
+
// styles has the form:
|
|
455
466
|
// const styles = {
|
|
456
|
-
//
|
|
457
|
-
//
|
|
467
|
+
// color: 'red',
|
|
468
|
+
// backgroundColor: '#AABBCC',
|
|
458
469
|
// }
|
|
459
470
|
// Returns: ['has--color--red', 'has--backgroundColor--AABBCC']
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
});
|
|
473
|
-
return styleArray.map((item) => {
|
|
474
|
-
const classname = item.map((item) => {
|
|
475
|
-
const str_item = item ? item.toString() : '';
|
|
476
|
-
return str_item && str_item.startsWith('#')
|
|
477
|
-
? str_item.replace('#', '')
|
|
478
|
-
: str_item;
|
|
479
|
-
});
|
|
480
|
-
return `has--${classname[0]}--${classname[1]}${
|
|
481
|
-
classname[2] ? `--${classname[2]}` : ''
|
|
482
|
-
}`;
|
|
483
|
-
});
|
|
471
|
+
|
|
472
|
+
return Object.entries(obj)
|
|
473
|
+
.reduce(
|
|
474
|
+
(acc, [k, v]) => [
|
|
475
|
+
...acc,
|
|
476
|
+
...(isObject(v)
|
|
477
|
+
? buildStyleClassNamesFromData(v, `${prefix}${k}--`)
|
|
478
|
+
: [styleToClassName(k, v, prefix)]),
|
|
479
|
+
],
|
|
480
|
+
[],
|
|
481
|
+
)
|
|
482
|
+
.filter((v) => !!v);
|
|
484
483
|
};
|
|
@@ -819,6 +819,7 @@ describe('Blocks', () => {
|
|
|
819
819
|
expect(applyBlockDefaults({ data })).toEqual({});
|
|
820
820
|
});
|
|
821
821
|
});
|
|
822
|
+
|
|
822
823
|
describe('buildStyleClassNamesFromData', () => {
|
|
823
824
|
it('Sets styles classname array according to style values', () => {
|
|
824
825
|
const styles = {
|
|
@@ -830,6 +831,7 @@ describe('Blocks', () => {
|
|
|
830
831
|
'has--backgroundColor--AABBCC',
|
|
831
832
|
]);
|
|
832
833
|
});
|
|
834
|
+
|
|
833
835
|
it('Sets styles classname array according to style values with nested', () => {
|
|
834
836
|
const styles = {
|
|
835
837
|
color: 'red',
|
|
@@ -846,6 +848,7 @@ describe('Blocks', () => {
|
|
|
846
848
|
'has--nested--bar--black',
|
|
847
849
|
]);
|
|
848
850
|
});
|
|
851
|
+
|
|
849
852
|
it('Sets styles classname array according to style values with nested and colors', () => {
|
|
850
853
|
const styles = {
|
|
851
854
|
color: 'red',
|
|
@@ -863,6 +866,27 @@ describe('Blocks', () => {
|
|
|
863
866
|
]);
|
|
864
867
|
});
|
|
865
868
|
|
|
869
|
+
it('Supports multiple nested level', () => {
|
|
870
|
+
const styles = {
|
|
871
|
+
color: 'red',
|
|
872
|
+
backgroundColor: '#AABBCC',
|
|
873
|
+
nested: {
|
|
874
|
+
l1: 'white',
|
|
875
|
+
level2: {
|
|
876
|
+
foo: '#fff',
|
|
877
|
+
bar: '#000',
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
};
|
|
881
|
+
expect(buildStyleClassNamesFromData(styles)).toEqual([
|
|
882
|
+
'has--color--red',
|
|
883
|
+
'has--backgroundColor--AABBCC',
|
|
884
|
+
'has--nested--l1--white',
|
|
885
|
+
'has--nested--level2--foo--fff',
|
|
886
|
+
'has--nested--level2--bar--000',
|
|
887
|
+
]);
|
|
888
|
+
});
|
|
889
|
+
|
|
866
890
|
it('Sets styles classname array according to style values with int values', () => {
|
|
867
891
|
const styles = {
|
|
868
892
|
color: 'red',
|
|
@@ -873,5 +897,45 @@ describe('Blocks', () => {
|
|
|
873
897
|
'has--borderRadius--8',
|
|
874
898
|
]);
|
|
875
899
|
});
|
|
900
|
+
|
|
901
|
+
it('Understands noprefix converter for style values', () => {
|
|
902
|
+
const styles = {
|
|
903
|
+
color: 'red',
|
|
904
|
+
'theme:noprefix': 'primary',
|
|
905
|
+
};
|
|
906
|
+
expect(buildStyleClassNamesFromData(styles)).toEqual([
|
|
907
|
+
'has--color--red',
|
|
908
|
+
'primary',
|
|
909
|
+
]);
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
it('Understands bool converter for trueish value', () => {
|
|
913
|
+
const styles = {
|
|
914
|
+
color: 'red',
|
|
915
|
+
'inverted:bool': true,
|
|
916
|
+
};
|
|
917
|
+
expect(buildStyleClassNamesFromData(styles)).toEqual([
|
|
918
|
+
'has--color--red',
|
|
919
|
+
'inverted',
|
|
920
|
+
]);
|
|
921
|
+
});
|
|
922
|
+
|
|
923
|
+
it('Understands bool converter for false value', () => {
|
|
924
|
+
const styles = {
|
|
925
|
+
color: 'red',
|
|
926
|
+
'inverted:bool': false,
|
|
927
|
+
};
|
|
928
|
+
expect(buildStyleClassNamesFromData(styles)).toEqual(['has--color--red']);
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
it('Ugly edge cases', () => {
|
|
932
|
+
const styles = {
|
|
933
|
+
color: undefined,
|
|
934
|
+
nested: {
|
|
935
|
+
l1: {},
|
|
936
|
+
},
|
|
937
|
+
};
|
|
938
|
+
expect(buildStyleClassNamesFromData(styles)).toEqual([]);
|
|
939
|
+
});
|
|
876
940
|
});
|
|
877
941
|
});
|
package/test-setup-config.js
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '@plone/volto/config/RichTextEditor/Blocks';
|
|
21
21
|
import FromHTMLCustomBlockFn from '@plone/volto/config/RichTextEditor/FromHTML';
|
|
22
22
|
import { contentIcons } from '@plone/volto/config/ContentIcons';
|
|
23
|
+
import { styleClassNameConverters } from '@plone/volto/config/Style';
|
|
23
24
|
|
|
24
25
|
import {
|
|
25
26
|
controlPanelsIcons,
|
|
@@ -74,6 +75,7 @@ config.set('settings', {
|
|
|
74
75
|
apiExpanders: [],
|
|
75
76
|
downloadableObjects: ['File'],
|
|
76
77
|
viewableInBrowserObjects: [],
|
|
78
|
+
styleClassNameConverters,
|
|
77
79
|
});
|
|
78
80
|
config.set('blocks', {
|
|
79
81
|
blocksConfig: {
|