@plone/volto 16.8.0 → 16.8.1

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.draft CHANGED
@@ -1,15 +1,6 @@
1
- ## 16.8.0 (2023-01-18)
2
-
3
- ### Feature
4
-
5
- - Autocomplete widget support for QueryStringWidget @sneridagh [#4177](https://github.com/plone/volto/issues/4177)
6
- - Enhance the StyleWrapper classNames generator by adding look around classNames depending on the sorounding previous/next blocks. @sneridagh [#4260](https://github.com/plone/volto/issues/4260)
1
+ ## 16.8.1 (2023-01-18)
7
2
 
8
3
  ### Bugfix
9
4
 
10
- - Fix typo in 4260 @sneridagh [#4268](https://github.com/plone/volto/issues/4268)
11
-
12
- ### Documentation
13
-
14
- - Update links to docs to use correct versions. [stevepiercy] [#4256](https://github.com/plone/volto/issues/4256)
5
+ - Fix StyleWrapper extenders, the classNames were not being re-fed into the pipe @sneridagh [#4275](https://github.com/plone/volto/issues/4275)
15
6
 
package/CHANGELOG.md CHANGED
@@ -8,6 +8,13 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.8.1 (2023-01-18)
12
+
13
+ ### Bugfix
14
+
15
+ - Fix StyleWrapper extenders, the classNames were not being re-fed into the pipe @sneridagh [#4275](https://github.com/plone/volto/issues/4275)
16
+
17
+
11
18
  ## 16.8.0 (2023-01-18)
12
19
 
13
20
  ### Feature
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "16.8.0",
12
+ "version": "16.8.1",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "16.8.0",
3
+ "version": "16.8.1",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -489,10 +489,15 @@ export const buildStyleClassNamesFromData = (obj = {}, prefix = '') => {
489
489
  * @param {Object} params An object with data, content and block (current block id)
490
490
  * @return {Array} Extender classNames resultant array
491
491
  */
492
- export const buildStyleClassNamesExtenders = ({ block, content, data }) => {
492
+ export const buildStyleClassNamesExtenders = ({
493
+ block,
494
+ content,
495
+ data,
496
+ classNames,
497
+ }) => {
493
498
  return config.settings.styleClassNameExtenders.reduce(
494
499
  (acc, extender) => extender({ block, content, data, classNames: acc }),
495
- [],
500
+ classNames,
496
501
  );
497
502
  };
498
503
 
@@ -1063,9 +1063,9 @@ describe('Blocks', () => {
1063
1063
  };
1064
1064
  const block = 2;
1065
1065
  const data = content['blocks'][2];
1066
-
1066
+ const classNames = [];
1067
1067
  expect(
1068
- buildStyleClassNamesExtenders({ block, content, data }),
1068
+ buildStyleClassNamesExtenders({ block, content, data, classNames }),
1069
1069
  ).toStrictEqual([
1070
1070
  'next--is--slate',
1071
1071
  'previous--is--same--block-type',
@@ -1103,9 +1103,10 @@ describe('Blocks', () => {
1103
1103
  };
1104
1104
  const block = 2;
1105
1105
  const data = content['blocks'][2];
1106
+ const classNames = [];
1106
1107
 
1107
1108
  expect(
1108
- buildStyleClassNamesExtenders({ block, content, data }),
1109
+ buildStyleClassNamesExtenders({ block, content, data, classNames }),
1109
1110
  ).toStrictEqual([
1110
1111
  'next--is--slate',
1111
1112
  'previous--is--same--block-type',
@@ -1140,9 +1141,10 @@ describe('Blocks', () => {
1140
1141
  };
1141
1142
  const block = 2;
1142
1143
  const data = content['blocks'][2];
1144
+ const classNames = [];
1143
1145
 
1144
1146
  expect(
1145
- buildStyleClassNamesExtenders({ block, content, data }),
1147
+ buildStyleClassNamesExtenders({ block, content, data, classNames }),
1146
1148
  ).toStrictEqual([
1147
1149
  'next--is--slate',
1148
1150
  'next--is--same--block-type',
@@ -1174,10 +1176,47 @@ describe('Blocks', () => {
1174
1176
  };
1175
1177
  const block = 2;
1176
1178
  const data = content['blocks'][2];
1179
+ const classNames = [];
1180
+
1181
+ expect(
1182
+ buildStyleClassNamesExtenders({ block, content, data, classNames }),
1183
+ ).toStrictEqual([
1184
+ 'next--is--slate',
1185
+ 'previous--is--same--block-type',
1186
+ 'is--last--of--block-type',
1187
+ 'previous--has--same--backgroundColor',
1188
+ 'next--has--different--backgroundColor',
1189
+ ]);
1190
+ });
1191
+
1192
+ it('grid + grid + slate grey - with existing classNames list', () => {
1193
+ const content = {
1194
+ blocks: {
1195
+ 1: {
1196
+ '@type': '__grid',
1197
+ },
1198
+ 2: {
1199
+ '@type': '__grid',
1200
+ },
1201
+ 3: {
1202
+ '@type': 'slate',
1203
+ styles: {
1204
+ backgroundColor: 'grey',
1205
+ },
1206
+ },
1207
+ },
1208
+ blocks_layout: {
1209
+ items: [1, 2, 3],
1210
+ },
1211
+ };
1212
+ const block = 2;
1213
+ const data = content['blocks'][2];
1214
+ const classNames = ['has--align--center'];
1177
1215
 
1178
1216
  expect(
1179
- buildStyleClassNamesExtenders({ block, content, data }),
1217
+ buildStyleClassNamesExtenders({ block, content, data, classNames }),
1180
1218
  ).toStrictEqual([
1219
+ 'has--align--center',
1181
1220
  'next--is--slate',
1182
1221
  'previous--is--same--block-type',
1183
1222
  'is--last--of--block-type',