@eeacms/volto-group-block 7.1.1 → 8.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 +20 -33
- package/locales/de/LC_MESSAGES/volto.po +0 -5
- package/locales/en/LC_MESSAGES/volto.po +0 -5
- package/locales/it/LC_MESSAGES/volto.po +0 -5
- package/locales/ro/LC_MESSAGES/volto.po +0 -5
- package/locales/volto.pot +1 -6
- package/package.json +1 -1
- package/src/components/manage/Blocks/Group/CounterComponent.jsx +41 -3
- package/src/components/manage/Blocks/Group/EditSchema.jsx +1 -9
- package/src/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [8.1.0](https://github.com/eea/volto-group-block/compare/8.0.0...8.1.0) - 3 December 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Add possibility to skip blocks from character counting - refs #293783 [Teodor Voicu - [`c35d76b`](https://github.com/eea/volto-group-block/commit/c35d76bd03476bbcf8324b247ecf909c093d4117)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Release 8.1.0 [Alin Voinea - [`d711911`](https://github.com/eea/volto-group-block/commit/d71191102f8ef97375905049c7cbbe71ea9e357c)]
|
|
16
|
+
## [8.0.0](https://github.com/eea/volto-group-block/compare/7.1.1...8.0.0) - 3 December 2025
|
|
17
|
+
|
|
18
|
+
#### :boom: Breaking Change
|
|
19
|
+
|
|
20
|
+
- breaking: Remove restricted block option as it requires backend support. Moved to volto-eea-website-theme [dobri1408 - [`e951557`](https://github.com/eea/volto-group-block/commit/e9515578ec6dccbcdcf076b0e9727394967b5706)]
|
|
21
|
+
|
|
22
|
+
#### :house: Internal changes
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#### :hammer_and_wrench: Others
|
|
26
|
+
|
|
7
27
|
### [7.1.1](https://github.com/eea/volto-group-block/compare/7.1.0...7.1.1) - 30 January 2025
|
|
8
28
|
|
|
9
29
|
#### :house: Internal changes
|
|
@@ -31,9 +51,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
31
51
|
|
|
32
52
|
#### :hammer_and_wrench: Others
|
|
33
53
|
|
|
34
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`e727ac6`](https://github.com/eea/volto-group-block/commit/e727ac6a8c1882b4e77a08fd0c5bb0a401cd3bdb)]
|
|
35
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`75c2946`](https://github.com/eea/volto-group-block/commit/75c29460dc6c42bbb799c13a5a6ef2bb8f26ed5a)]
|
|
36
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`96f3133`](https://github.com/eea/volto-group-block/commit/96f31335cdda925daf3e5824f0a23121b0c9b3ef)]
|
|
37
54
|
### [6.4.0](https://github.com/eea/volto-group-block/compare/6.3.5...6.4.0) - 17 January 2024
|
|
38
55
|
|
|
39
56
|
#### :rocket: New Features
|
|
@@ -48,7 +65,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
48
65
|
|
|
49
66
|
#### :house: Internal changes
|
|
50
67
|
|
|
51
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`616f6eb`](https://github.com/eea/volto-group-block/commit/616f6ebe0385d82a827c6679eabdcf4e92a18c11)]
|
|
52
68
|
|
|
53
69
|
#### :hammer_and_wrench: Others
|
|
54
70
|
|
|
@@ -61,11 +77,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
61
77
|
- Prettier [kreafox - [`0c5d2d1`](https://github.com/eea/volto-group-block/commit/0c5d2d1a494489663cc97c5dc0f4ad13c4b67c8d)]
|
|
62
78
|
- test: mock useLocation [kreafox - [`746887f`](https://github.com/eea/volto-group-block/commit/746887fa0e778f2d4cbe86661fc8c38c8a4bafb5)]
|
|
63
79
|
- test: mock useLocation [kreafox - [`a360401`](https://github.com/eea/volto-group-block/commit/a360401b8ee05e9cb54b253b0e605d0a040c8f78)]
|
|
64
|
-
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`25030fb`](https://github.com/eea/volto-group-block/commit/25030fbd69108f90df02130e5010e56398941ad2)]
|
|
65
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1517dbb`](https://github.com/eea/volto-group-block/commit/1517dbb81cf9128752d835ae59dc22b251f4b035)]
|
|
66
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`b0ba5f9`](https://github.com/eea/volto-group-block/commit/b0ba5f9c6d37526411a7a984595ac624401f8ac5)]
|
|
67
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`8dbdfeb`](https://github.com/eea/volto-group-block/commit/8dbdfeb89fe53c6dc2f476b183a53c9266ab2bdf)]
|
|
68
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`d0324f4`](https://github.com/eea/volto-group-block/commit/d0324f4aad6d94233ca8ce3645ca5162f39d9834)]
|
|
69
80
|
### [6.3.4](https://github.com/eea/volto-group-block/compare/6.3.3...6.3.4) - 22 October 2023
|
|
70
81
|
|
|
71
82
|
### [6.3.3](https://github.com/eea/volto-group-block/compare/6.3.2...6.3.3) - 17 October 2023
|
|
@@ -113,7 +124,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
113
124
|
|
|
114
125
|
- Release #39 from eea/develop [ichim-david - [`283e1e8`](https://github.com/eea/volto-group-block/commit/283e1e8dd1047415bae054cfd502d1691deaeb59)]
|
|
115
126
|
- Release 6.3.0 [Alin Voinea - [`3d74bb5`](https://github.com/eea/volto-group-block/commit/3d74bb5342e3882e0ddee1aa8edab7e90949def6)]
|
|
116
|
-
- test: Fix eslint and yarn i18n [Alin Voinea - [`763f764`](https://github.com/eea/volto-group-block/commit/763f76448625e05b53a2bde86ca48dda0cb263cb)]
|
|
117
127
|
- i18n: Add en [Alin Voinea - [`f3385cd`](https://github.com/eea/volto-group-block/commit/f3385cd33bfbe3efe514fd82fd140d17e33051e1)]
|
|
118
128
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`3aa996b`](https://github.com/eea/volto-group-block/commit/3aa996b4c115da6f37ca771f07f10d58fbfa33e8)]
|
|
119
129
|
- fix eslint warnings [nileshgulia1 - [`cfdf2e9`](https://github.com/eea/volto-group-block/commit/cfdf2e900bcc456fa5a24ce7b03859170ad024ba)]
|
|
@@ -144,7 +154,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
144
154
|
|
|
145
155
|
#### :house: Internal changes
|
|
146
156
|
|
|
147
|
-
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`ad30e83`](https://github.com/eea/volto-group-block/commit/ad30e832bb869b67dc4e64ed99590b51cb80ab75)]
|
|
148
157
|
|
|
149
158
|
#### :hammer_and_wrench: Others
|
|
150
159
|
|
|
@@ -161,19 +170,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
161
170
|
|
|
162
171
|
#### :hammer_and_wrench: Others
|
|
163
172
|
|
|
164
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`37ffae5`](https://github.com/eea/volto-group-block/commit/37ffae512967b36af22cbed208a3ec9e1ddc392b)]
|
|
165
173
|
## [6.0.0](https://github.com/eea/volto-group-block/compare/5.0.1...6.0.0) - 24 March 2023
|
|
166
174
|
|
|
167
175
|
#### :hammer_and_wrench: Others
|
|
168
176
|
|
|
169
177
|
- (feat): Possibility to copy/cut/paste blocks within section group block - refs #157469 [dobri1408 - [`e9fc098`](https://github.com/eea/volto-group-block/commit/e9fc09825ba2ae258feb77864491d97d94c585b4)]
|
|
170
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`db4b09a`](https://github.com/eea/volto-group-block/commit/db4b09a6c14a8b271dec0c766886ffbcc3fe205e)]
|
|
171
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`b8c2bf4`](https://github.com/eea/volto-group-block/commit/b8c2bf471868bb0394b2dbbf75ccb7917a9ef0bf)]
|
|
172
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`b343119`](https://github.com/eea/volto-group-block/commit/b3431196931fd568476fa8bf6fbc508e086229ae)]
|
|
173
178
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2f42e7c`](https://github.com/eea/volto-group-block/commit/2f42e7c19a1da5a9c6a883cb4f101e8fa224ff94)]
|
|
174
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`73afcc2`](https://github.com/eea/volto-group-block/commit/73afcc2f417797cedaa78cceefb007001d6c2406)]
|
|
175
|
-
- yarn 3 [Alin Voinea - [`3c00ccc`](https://github.com/eea/volto-group-block/commit/3c00ccc7110bbf12a4d268182313418fb46b1a5d)]
|
|
176
|
-
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`9b9662b`](https://github.com/eea/volto-group-block/commit/9b9662bda1da70ba0c3a7b4b05cebf130ed89e9e)]
|
|
177
179
|
### [5.0.1](https://github.com/eea/volto-group-block/compare/5.0.0...5.0.1) - 16 November 2022
|
|
178
180
|
|
|
179
181
|
#### :nail_care: Enhancements
|
|
@@ -190,8 +192,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
190
192
|
|
|
191
193
|
- Prepare 5.0.0 release [Miu Razvan - [`88c0ddd`](https://github.com/eea/volto-group-block/commit/88c0ddd569aeda7ee34d1eadea6a087f4e7dc257)]
|
|
192
194
|
- Update dependencies [Alin Voinea - [`c8405af`](https://github.com/eea/volto-group-block/commit/c8405afb830cdf62e7877bf30b619933519e1d71)]
|
|
193
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`18e26c6`](https://github.com/eea/volto-group-block/commit/18e26c6939706d572ab8574e9b1826b9abc76314)]
|
|
194
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`8ed6d21`](https://github.com/eea/volto-group-block/commit/8ed6d21d8489911cc4cb471e3f8823c35f4adc50)]
|
|
195
195
|
### [4.3.8](https://github.com/eea/volto-group-block/compare/4.3.7...4.3.8) - 26 August 2022
|
|
196
196
|
|
|
197
197
|
### [4.3.7](https://github.com/eea/volto-group-block/compare/4.3.6...4.3.7) - 22 August 2022
|
|
@@ -204,9 +204,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
204
204
|
|
|
205
205
|
#### :hammer_and_wrench: Others
|
|
206
206
|
|
|
207
|
-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`4e73f8b`](https://github.com/eea/volto-group-block/commit/4e73f8be3c73559557efadc410cb56abc055d82d)]
|
|
208
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`3040335`](https://github.com/eea/volto-group-block/commit/3040335002c63b50208c95918413bc958150e7a9)]
|
|
209
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`386f730`](https://github.com/eea/volto-group-block/commit/386f730ed65f73fe1468b9b77351c97fb70edcc5)]
|
|
210
207
|
### [4.3.5](https://github.com/eea/volto-group-block/compare/4.3.4...4.3.5) - 4 January 2022
|
|
211
208
|
|
|
212
209
|
### [4.3.4](https://github.com/eea/volto-group-block/compare/4.3.3...4.3.4) - 3 January 2022
|
|
@@ -215,23 +212,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
215
212
|
|
|
216
213
|
#### :hammer_and_wrench: Others
|
|
217
214
|
|
|
218
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3e62d79`](https://github.com/eea/volto-group-block/commit/3e62d79a7ed37d10d623bc845d43e1144f8080f7)]
|
|
219
215
|
### [4.3.2](https://github.com/eea/volto-group-block/compare/4.3.1...4.3.2) - 10 December 2021
|
|
220
216
|
|
|
221
217
|
#### :hammer_and_wrench: Others
|
|
222
218
|
|
|
223
219
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`bc36cf5`](https://github.com/eea/volto-group-block/commit/bc36cf58c39e2b43c2fbf5189df6ddefc1260857)]
|
|
224
|
-
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`8038e78`](https://github.com/eea/volto-group-block/commit/8038e783c1e8ddd71e21f72070fdfa8e7e098993)]
|
|
225
|
-
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`daccdbc`](https://github.com/eea/volto-group-block/commit/daccdbc733e47be7d6536eb67f8f2eea038dc94b)]
|
|
226
220
|
### [4.3.1](https://github.com/eea/volto-group-block/compare/4.3.0...4.3.1) - 11 October 2021
|
|
227
221
|
|
|
228
222
|
#### :hammer_and_wrench: Others
|
|
229
223
|
|
|
230
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`b0092e4`](https://github.com/eea/volto-group-block/commit/b0092e4f78a1a0184e22e32bb9806cd57417dfb2)]
|
|
231
|
-
- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`ff8889c`](https://github.com/eea/volto-group-block/commit/ff8889cb7b0761b1df43b201984ce40b14e1561b)]
|
|
232
|
-
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`0375c28`](https://github.com/eea/volto-group-block/commit/0375c28ed1ffe9186a4790b454795c0ca8039f72)]
|
|
233
|
-
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`c392190`](https://github.com/eea/volto-group-block/commit/c392190f044f5d9397bd2fb8c3d6a357f84960d0)]
|
|
234
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`9694501`](https://github.com/eea/volto-group-block/commit/9694501141e6780eba89464d36406e3c93629fd8)]
|
|
235
224
|
### [4.3.0](https://github.com/eea/volto-group-block/compare/4.2.3...4.3.0) - 24 June 2021
|
|
236
225
|
|
|
237
226
|
#### :hammer_and_wrench: Others
|
|
@@ -347,7 +336,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
347
336
|
- Release 1.0.0 [Alin Voinea - [`b6ef873`](https://github.com/eea/volto-group-block/commit/b6ef873cb6f61e17db66fdd4de1d9d4902a66fc6)]
|
|
348
337
|
- Update package meta info [Alin Voinea - [`143b7d4`](https://github.com/eea/volto-group-block/commit/143b7d44438d7afa5e346a9d21a85352df4e925f)]
|
|
349
338
|
- Add Jenkinkins pipeline [Alin Voinea - [`866a4e1`](https://github.com/eea/volto-group-block/commit/866a4e14ea1eb8f5adb01222e576e5ab6dc73a70)]
|
|
350
|
-
- yarn prettier [Alin Voinea - [`e3fe0a3`](https://github.com/eea/volto-group-block/commit/e3fe0a36b89878769341b45198d6c9e2f2584d15)]
|
|
351
339
|
### [0.1.3](https://github.com/eea/volto-group-block/compare/0.1.2...0.1.3) - 9 November 2020
|
|
352
340
|
|
|
353
341
|
#### :hammer_and_wrench: Others
|
|
@@ -387,5 +375,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
387
375
|
- Render meta block [Alin Voinea - [`0d44560`](https://github.com/eea/volto-group-block/commit/0d4456011ca56454068a54c610250b02df4ccb3b)]
|
|
388
376
|
- Implement meta block allowedBlocks settings [Alin Voinea - [`f24feb1`](https://github.com/eea/volto-group-block/commit/f24feb1a1751f04841c21c7cd52a517fb02074ba)]
|
|
389
377
|
- Edit meta block [Alin Voinea - [`236d291`](https://github.com/eea/volto-group-block/commit/236d29156fa835a7aa54eecdb4f120de0d64b271)]
|
|
390
|
-
- yarn bootstrap [Alin Voinea - [`e009dfb`](https://github.com/eea/volto-group-block/commit/e009dfb6b9b74d101a6722f0982a5359fc522b6b)]
|
|
391
378
|
- Initial commit [Alin Voinea - [`6a7b0de`](https://github.com/eea/volto-group-block/commit/6a7b0deb8f873d1462fd6a9c61edfc1562b3aace)]
|
|
@@ -56,11 +56,6 @@ msgstr "Standard"
|
|
|
56
56
|
msgid "removeBlock"
|
|
57
57
|
msgstr "Block entfernen"
|
|
58
58
|
|
|
59
|
-
#. Default: "Restricted block"
|
|
60
|
-
#: components/manage/Blocks/Group/EditSchema
|
|
61
|
-
msgid "restrictedBlockTitle"
|
|
62
|
-
msgstr "Eingeschränkter Block"
|
|
63
|
-
|
|
64
59
|
#. Default: "Section block"
|
|
65
60
|
#: components/manage/Blocks/Group/EditSchema
|
|
66
61
|
msgid "sectionBlock"
|
|
@@ -56,11 +56,6 @@ msgstr ""
|
|
|
56
56
|
msgid "removeBlock"
|
|
57
57
|
msgstr ""
|
|
58
58
|
|
|
59
|
-
#. Default: "Restricted block"
|
|
60
|
-
#: components/manage/Blocks/Group/EditSchema
|
|
61
|
-
msgid "restrictedBlockTitle"
|
|
62
|
-
msgstr ""
|
|
63
|
-
|
|
64
59
|
#. Default: "Section block"
|
|
65
60
|
#: components/manage/Blocks/Group/EditSchema
|
|
66
61
|
msgid "sectionBlock"
|
|
@@ -56,11 +56,6 @@ msgstr ""
|
|
|
56
56
|
msgid "removeBlock"
|
|
57
57
|
msgstr ""
|
|
58
58
|
|
|
59
|
-
#. Default: "Restricted block"
|
|
60
|
-
#: components/manage/Blocks/Group/EditSchema
|
|
61
|
-
msgid "restrictedBlockTitle"
|
|
62
|
-
msgstr ""
|
|
63
|
-
|
|
64
59
|
#. Default: "Section block"
|
|
65
60
|
#: components/manage/Blocks/Group/EditSchema
|
|
66
61
|
msgid "sectionBlock"
|
|
@@ -56,11 +56,6 @@ msgstr ""
|
|
|
56
56
|
msgid "removeBlock"
|
|
57
57
|
msgstr ""
|
|
58
58
|
|
|
59
|
-
#. Default: "Restricted block"
|
|
60
|
-
#: components/manage/Blocks/Group/EditSchema
|
|
61
|
-
msgid "restrictedBlockTitle"
|
|
62
|
-
msgstr ""
|
|
63
|
-
|
|
64
59
|
#. Default: "Section block"
|
|
65
60
|
#: components/manage/Blocks/Group/EditSchema
|
|
66
61
|
msgid "sectionBlock"
|
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2025-
|
|
4
|
+
"POT-Creation-Date: 2025-06-01T18:33:19.620Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
@@ -58,11 +58,6 @@ msgstr ""
|
|
|
58
58
|
msgid "removeBlock"
|
|
59
59
|
msgstr ""
|
|
60
60
|
|
|
61
|
-
#. Default: "Restricted block"
|
|
62
|
-
#: components/manage/Blocks/Group/EditSchema
|
|
63
|
-
msgid "restrictedBlockTitle"
|
|
64
|
-
msgstr ""
|
|
65
|
-
|
|
66
61
|
#. Default: "Section block"
|
|
67
62
|
#: components/manage/Blocks/Group/EditSchema
|
|
68
63
|
msgid "sectionBlock"
|
package/package.json
CHANGED
|
@@ -10,8 +10,38 @@ import dissatisfiedSVG from '@plone/volto/icons/dissatisfied.svg';
|
|
|
10
10
|
import { countCharsWithoutSpaces, countCharsWithSpaces } from './utils';
|
|
11
11
|
|
|
12
12
|
const countTextInEachBlock =
|
|
13
|
-
(
|
|
13
|
+
(
|
|
14
|
+
countTextIn,
|
|
15
|
+
ignoreSpaces,
|
|
16
|
+
groupCharCount,
|
|
17
|
+
skipBlockIds = new Set(),
|
|
18
|
+
skipBlocksInGroups = [],
|
|
19
|
+
) =>
|
|
14
20
|
([id, blockData]) => {
|
|
21
|
+
// Track group blocks matching skip criteria and their children
|
|
22
|
+
if (blockData?.['@type'] === 'group') {
|
|
23
|
+
const shouldSkip = skipBlocksInGroups.some((criteria) => {
|
|
24
|
+
// Check if all criteria match
|
|
25
|
+
return Object.keys(criteria).every((key) => {
|
|
26
|
+
return blockData?.[key] === criteria[key];
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (shouldSkip) {
|
|
31
|
+
// Get all child block IDs from this group and mark them to be skipped
|
|
32
|
+
if (blockData?.data?.blocks) {
|
|
33
|
+
Object.keys(blockData.data.blocks).forEach((childId) => {
|
|
34
|
+
skipBlockIds.add(childId);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Skip counting if this block is inside a skipped group
|
|
41
|
+
if (skipBlockIds.has(id)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
15
45
|
const foundText =
|
|
16
46
|
blockData && countTextIn?.includes(blockData?.['@type'])
|
|
17
47
|
? isString(blockData?.plaintext)
|
|
@@ -27,9 +57,11 @@ const countTextInEachBlock =
|
|
|
27
57
|
};
|
|
28
58
|
|
|
29
59
|
const countTextInBlocks = (blocksObject, ignoreSpaces, maxChars) => {
|
|
30
|
-
const { countTextIn
|
|
60
|
+
const { countTextIn, skipBlocksInGroups = [] } =
|
|
61
|
+
config.blocks?.blocksConfig?.group || {};
|
|
31
62
|
// use obj ref to update value - if you send number it will not be updated
|
|
32
63
|
const groupCharCount = { value: 0 };
|
|
64
|
+
const skipBlockIds = new Set();
|
|
33
65
|
|
|
34
66
|
if (!maxChars || !blocksObject) {
|
|
35
67
|
return groupCharCount.value;
|
|
@@ -37,7 +69,13 @@ const countTextInBlocks = (blocksObject, ignoreSpaces, maxChars) => {
|
|
|
37
69
|
|
|
38
70
|
visitBlocks(
|
|
39
71
|
blocksObject,
|
|
40
|
-
countTextInEachBlock(
|
|
72
|
+
countTextInEachBlock(
|
|
73
|
+
countTextIn,
|
|
74
|
+
ignoreSpaces,
|
|
75
|
+
groupCharCount,
|
|
76
|
+
skipBlockIds,
|
|
77
|
+
skipBlocksInGroups,
|
|
78
|
+
),
|
|
41
79
|
);
|
|
42
80
|
|
|
43
81
|
return groupCharCount.value;
|
|
@@ -25,10 +25,6 @@ const messages = defineMessages({
|
|
|
25
25
|
id: 'asPropertyDescription',
|
|
26
26
|
defaultMessage: 'Select HTML5 element to be used for this block',
|
|
27
27
|
},
|
|
28
|
-
restrictedBlockTitle: {
|
|
29
|
-
id: 'restrictedBlockTitle',
|
|
30
|
-
defaultMessage: 'Restricted block',
|
|
31
|
-
},
|
|
32
28
|
});
|
|
33
29
|
|
|
34
30
|
const Schema = (intl) => ({
|
|
@@ -37,7 +33,7 @@ const Schema = (intl) => ({
|
|
|
37
33
|
{
|
|
38
34
|
id: 'default',
|
|
39
35
|
title: intl.formatMessage(messages.fieldsetDefaultTitle),
|
|
40
|
-
fields: ['title', 'as'
|
|
36
|
+
fields: ['title', 'as'],
|
|
41
37
|
},
|
|
42
38
|
],
|
|
43
39
|
properties: {
|
|
@@ -60,10 +56,6 @@ const Schema = (intl) => ({
|
|
|
60
56
|
['details', 'details'],
|
|
61
57
|
],
|
|
62
58
|
},
|
|
63
|
-
restrictedBlock: {
|
|
64
|
-
title: intl.formatMessage(messages.restrictedBlockTitle),
|
|
65
|
-
type: 'boolean',
|
|
66
|
-
},
|
|
67
59
|
},
|
|
68
60
|
required: [],
|
|
69
61
|
});
|
package/src/index.js
CHANGED
|
@@ -93,6 +93,7 @@ const applyConfig = (config) => {
|
|
|
93
93
|
return entries;
|
|
94
94
|
},
|
|
95
95
|
countTextIn: ['slate', 'description'], //id of the block whose text should be counted
|
|
96
|
+
skipBlocksInGroups: [], // Array of group criteria to skip when counting chars. Each item can have: { className: 'group-class-name' }
|
|
96
97
|
};
|
|
97
98
|
|
|
98
99
|
return config;
|