@eeacms/volto-eea-website-theme 4.3.8 → 4.4.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 +12 -26
- package/package.json +1 -1
- package/src/customizations/@plone/volto-slate/blocks/Text/keyboard/joinBlocks.js +228 -0
- package/src/customizations/@plone/volto-slate/blocks/Text/keyboard/joinBlocks.js.diff +30 -0
- package/src/customizations/@plone/volto-slate/blocks/Text/keyboard/joinBlocks.js.md +10 -0
- package/src/customizations/@plone/volto-slate/utils/selection.js +271 -0
- package/src/customizations/@plone/volto-slate/utils/selection.js.diff +63 -0
- package/src/customizations/@plone/volto-slate/utils/selection.js.md +7 -0
- package/src/customizations/@plone/volto-slate/utils/selection.test.js +116 -0
- package/src/customizations/@plone/volto-slate/utils/volto-blocks.js +350 -0
- package/src/customizations/@plone/volto-slate/utils/volto-blocks.js.diff +61 -0
- package/src/customizations/@plone/volto-slate/utils/volto-blocks.js.md +9 -0
- package/src/customizations/volto/helpers/Html/Html.jsx +7 -9
- package/src/customizations/volto/server.jsx +0 -4
- package/src/index.js +0 -4
- package/src/index.test.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,22 @@ 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
|
+
### [4.4.0](https://github.com/eea/volto-eea-website-theme/compare/4.3.9...4.4.0) - 24 June 2026
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: Backspace behaving erratically near a styled or link text - refs #304369 [Alin Voinea - [`7f9fc05`](https://github.com/eea/volto-eea-website-theme/commit/7f9fc05814a0008a115596c5ef1875ef65269fac)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Release 4.4.0 [Alin Voinea - [`3ae92a0`](https://github.com/eea/volto-eea-website-theme/commit/3ae92a071a6929611c5cac1b8f152be863a84eb4)]
|
|
16
|
+
### [4.3.9](https://github.com/eea/volto-eea-website-theme/compare/4.3.8...4.3.9) - 23 June 2026
|
|
17
|
+
|
|
7
18
|
### [4.3.8](https://github.com/eea/volto-eea-website-theme/compare/4.3.7...4.3.8) - 9 June 2026
|
|
8
19
|
|
|
9
20
|
#### :bug: Bug Fixes
|
|
10
21
|
|
|
22
|
+
- fix: Header images unsized CLS - refs #304010 [Alin Voinea - [`ce86b94`](https://github.com/eea/volto-eea-website-theme/commit/ce86b94ef5bd9095ba496ce91f0cfbdbe77996b0)]
|
|
11
23
|
- fix: Header images unsized CLS - refs #304010 [dobri1408 - [`7074063`](https://github.com/eea/volto-eea-website-theme/commit/7074063622e187e201d9cb36b2000b29387ec0dd)]
|
|
12
24
|
|
|
13
25
|
### [4.3.7](https://github.com/eea/volto-eea-website-theme/compare/4.3.6...4.3.7) - 6 June 2026
|
|
@@ -119,8 +131,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
119
131
|
|
|
120
132
|
#### :house: Internal changes
|
|
121
133
|
|
|
122
|
-
- chore: [JENKINSFILE] add package version in sonarqube [valentinab25 - [`b15b302`](https://github.com/eea/volto-eea-website-theme/commit/b15b302ff88ec6afa6901ee7e1726cc4e04a8739)]
|
|
123
|
-
- chore: [JENKINSFILE] use sonarqube branches [EEA Jenkins - [`36f2e1e`](https://github.com/eea/volto-eea-website-theme/commit/36f2e1e176471b3753d77ab8aaf0cba577b43b36)]
|
|
124
134
|
|
|
125
135
|
### [3.19.0](https://github.com/eea/volto-eea-website-theme/compare/3.18.1...3.19.0) - 11 February 2026
|
|
126
136
|
|
|
@@ -183,7 +193,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
183
193
|
#### :hammer_and_wrench: Others
|
|
184
194
|
|
|
185
195
|
- Release 3.12.0 [Alin Voinea - [`ea1e961`](https://github.com/eea/volto-eea-website-theme/commit/ea1e96144684b2a8238ae476fd8d47de82ff42b4)]
|
|
186
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`2cac56e`](https://github.com/eea/volto-eea-website-theme/commit/2cac56e22e580e042d368b69254172539ed33b65)]
|
|
187
196
|
### [3.11.0](https://github.com/eea/volto-eea-website-theme/compare/3.10.1...3.11.0) - 29 September 2025
|
|
188
197
|
|
|
189
198
|
#### :bug: Bug Fixes
|
|
@@ -277,8 +286,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
277
286
|
|
|
278
287
|
#### :hammer_and_wrench: Others
|
|
279
288
|
|
|
280
|
-
- Add Sonarqube tag using fise-frontend addons list [EEA Jenkins - [`3d50874`](https://github.com/eea/volto-eea-website-theme/commit/3d50874281ebcb91a1ae3727248f656a6f26c603)]
|
|
281
|
-
- Add Sonarqube tag using ied-frontend addons list [EEA Jenkins - [`a3f7676`](https://github.com/eea/volto-eea-website-theme/commit/a3f76767d99cb6dd93cc7fa0eafdea57e9000b2c)]
|
|
282
289
|
### [3.5.4](https://github.com/eea/volto-eea-website-theme/compare/3.5.3...3.5.4) - 30 January 2025
|
|
283
290
|
|
|
284
291
|
#### :bug: Bug Fixes
|
|
@@ -379,7 +386,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
379
386
|
|
|
380
387
|
#### :hammer_and_wrench: Others
|
|
381
388
|
|
|
382
|
-
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`e417f83`](https://github.com/eea/volto-eea-website-theme/commit/e417f839312045c56b67ab8134fe5b0622b3e2c3)]
|
|
383
389
|
## [3.0.0](https://github.com/eea/volto-eea-website-theme/compare/2.4.0...3.0.0) - 21 October 2024
|
|
384
390
|
|
|
385
391
|
#### :nail_care: Enhancements
|
|
@@ -465,7 +471,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
465
471
|
- Refs #269520 - other_organisation test [Tripon Eugen - [`7558b27`](https://github.com/eea/volto-eea-website-theme/commit/7558b27a9d1cd6d3480a32b296c7325c796006c9)]
|
|
466
472
|
- Refs #269520 - other_organisation token widget edit mode [Tripon Eugen - [`b6df127`](https://github.com/eea/volto-eea-website-theme/commit/b6df127bd91b6f55dda8f468e1107037d43752ff)]
|
|
467
473
|
- Refs #269520 - other_organisation token widget [Tripon Eugen - [`6fd7543`](https://github.com/eea/volto-eea-website-theme/commit/6fd7543894bd2c593a1729116befd95c82ea3c8f)]
|
|
468
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`cbc36c7`](https://github.com/eea/volto-eea-website-theme/commit/cbc36c74dfcd5f7cb1013a4c673d9c02e0023766)]
|
|
469
474
|
### [2.1.1](https://github.com/eea/volto-eea-website-theme/compare/2.1.0...2.1.1) - 28 May 2024
|
|
470
475
|
|
|
471
476
|
#### :bug: Bug Fixes
|
|
@@ -550,7 +555,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
550
555
|
|
|
551
556
|
#### :hammer_and_wrench: Others
|
|
552
557
|
|
|
553
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`adc6730`](https://github.com/eea/volto-eea-website-theme/commit/adc6730e21a37afb865b842182624401de6a29f5)]
|
|
554
558
|
### [1.33.1](https://github.com/eea/volto-eea-website-theme/compare/1.33.0...1.33.1) - 4 April 2024
|
|
555
559
|
|
|
556
560
|
#### :bug: Bug Fixes
|
|
@@ -684,8 +688,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
684
688
|
|
|
685
689
|
- bump version [Razvan - [`721e939`](https://github.com/eea/volto-eea-website-theme/commit/721e939d12e324b459ebfa78a2e656ee7142a3d6)]
|
|
686
690
|
- merge master into this branch [Razvan - [`586c8f9`](https://github.com/eea/volto-eea-website-theme/commit/586c8f910bac55a043bd8dda60e9444bd2ae1663)]
|
|
687
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`fd90044`](https://github.com/eea/volto-eea-website-theme/commit/fd9004442a9d1d465f7601ecdefe3e23c61e6a9c)]
|
|
688
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`4bc3dd3`](https://github.com/eea/volto-eea-website-theme/commit/4bc3dd3ae412a66befd04b5b80fab3716c929240)]
|
|
689
691
|
- test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`c4dbd28`](https://github.com/eea/volto-eea-website-theme/commit/c4dbd289358205bc2d849aab7edb11ccf3b89cee)]
|
|
690
692
|
- fix tests [Razvan - [`042330b`](https://github.com/eea/volto-eea-website-theme/commit/042330bc97d32ffe7ba769b4f2453f71cffed706)]
|
|
691
693
|
- remove RemoveSchema logic [Razvan - [`08d10f8`](https://github.com/eea/volto-eea-website-theme/commit/08d10f8bf6f75478260e4e4c66d7316ba87b907a)]
|
|
@@ -780,11 +782,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
780
782
|
- test: Add real image to cypress test [Alin Voinea - [`4ff591a`](https://github.com/eea/volto-eea-website-theme/commit/4ff591ae3318c9588b4e2114582c0fa6cfdf31ae)]
|
|
781
783
|
- test: Add cypress tests for Image block styling position and align [Alin Voinea - [`7341ef7`](https://github.com/eea/volto-eea-website-theme/commit/7341ef7b92714fc0cc3ab0c31c39033e7b3e19e7)]
|
|
782
784
|
- Revert "change(tests): commented out rss test since title block config is missing" [Alin Voinea - [`fb61191`](https://github.com/eea/volto-eea-website-theme/commit/fb611918d6ca380b89b594f283dcf9f685a4b294)]
|
|
783
|
-
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`6a3be30`](https://github.com/eea/volto-eea-website-theme/commit/6a3be3092589411af7808a235f76de5222fd3868)]
|
|
784
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c3978f2`](https://github.com/eea/volto-eea-website-theme/commit/c3978f23375ef066e9fd6f6c2e34ba6c1c058f69)]
|
|
785
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`f672779`](https://github.com/eea/volto-eea-website-theme/commit/f672779e845bec9240ccc901e9f53ec80c5a1819)]
|
|
786
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`ae5d8e3`](https://github.com/eea/volto-eea-website-theme/commit/ae5d8e3f4e04dc2808d47ce2ee886e1b23b528da)]
|
|
787
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`170ff0c`](https://github.com/eea/volto-eea-website-theme/commit/170ff0c8e3b30e69479bdf1117e811fea94f1027)]
|
|
788
785
|
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
|
789
786
|
|
|
790
787
|
#### :rocket: New Features
|
|
@@ -797,7 +794,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
797
794
|
|
|
798
795
|
#### :house: Internal changes
|
|
799
796
|
|
|
800
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f28fce3`](https://github.com/eea/volto-eea-website-theme/commit/f28fce3d1eb815f95fb9aa40de42b10b7e8e30c5)]
|
|
801
797
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
|
|
802
798
|
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
|
|
803
799
|
|
|
@@ -983,7 +979,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
983
979
|
|
|
984
980
|
#### :house: Internal changes
|
|
985
981
|
|
|
986
|
-
- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`370dcbf`](https://github.com/eea/volto-eea-website-theme/commit/370dcbfbf1a8135ce7b1b3b271b004552a631837)]
|
|
987
982
|
|
|
988
983
|
#### :hammer_and_wrench: Others
|
|
989
984
|
|
|
@@ -1139,7 +1134,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1139
1134
|
|
|
1140
1135
|
#### :hammer_and_wrench: Others
|
|
1141
1136
|
|
|
1142
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`6c5e2f8`](https://github.com/eea/volto-eea-website-theme/commit/6c5e2f80456e2061d9e9c15fd0a0b91b9ac70568)]
|
|
1143
1137
|
### [1.9.1](https://github.com/eea/volto-eea-website-theme/compare/1.9.0...1.9.1) - 28 February 2023
|
|
1144
1138
|
|
|
1145
1139
|
#### :bug: Bug Fixes
|
|
@@ -1286,7 +1280,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1286
1280
|
|
|
1287
1281
|
- For some reasons types is a string [Alin Voinea - [`3769a09`](https://github.com/eea/volto-eea-website-theme/commit/3769a0981181d5b633f3498daebbe96be8b4b833)]
|
|
1288
1282
|
- Fix(redirect): o.filter - refs #157627 [Alin Voinea - [`deb23da`](https://github.com/eea/volto-eea-website-theme/commit/deb23da846444cc96539697fd798429ae0abe89e)]
|
|
1289
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`f1fffc5`](https://github.com/eea/volto-eea-website-theme/commit/f1fffc5db96725440863d545580b4e76cce4b796)]
|
|
1290
1283
|
### [1.5.0](https://github.com/eea/volto-eea-website-theme/compare/1.4.2...1.5.0) - 9 January 2023
|
|
1291
1284
|
|
|
1292
1285
|
#### :hammer_and_wrench: Others
|
|
@@ -1320,7 +1313,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1320
1313
|
|
|
1321
1314
|
- Release 1.4.0 [Alin Voinea - [`bd42a0d`](https://github.com/eea/volto-eea-website-theme/commit/bd42a0d26e928cac5d99933194755da3db06b341)]
|
|
1322
1315
|
- bump version to use as volto-eea-design-system [David Ichim - [`f4be047`](https://github.com/eea/volto-eea-website-theme/commit/f4be047328b46399b03b612d378b18aaf82e7dc1)]
|
|
1323
|
-
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9b7cfef`](https://github.com/eea/volto-eea-website-theme/commit/9b7cfefb4d34fc1c948015e491feb370f9795bd8)]
|
|
1324
1316
|
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`df252a9`](https://github.com/eea/volto-eea-website-theme/commit/df252a9bfed0bb86cadf53c59dd1603b1e2cd822)]
|
|
1325
1317
|
### [1.3.2](https://github.com/eea/volto-eea-website-theme/compare/1.3.1...1.3.2) - 16 December 2022
|
|
1326
1318
|
|
|
@@ -1330,7 +1322,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1330
1322
|
|
|
1331
1323
|
#### :hammer_and_wrench: Others
|
|
1332
1324
|
|
|
1333
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`a43c658`](https://github.com/eea/volto-eea-website-theme/commit/a43c658a7920c8df95e763b9a637f38ce77eba2c)]
|
|
1334
1325
|
- Better razzle.config [Tiberiu Ichim - [`81dbf48`](https://github.com/eea/volto-eea-website-theme/commit/81dbf48815fb27facb4f82c9b764540fdf188b2e)]
|
|
1335
1326
|
- Better razzle.config [Tiberiu Ichim - [`7bc9da2`](https://github.com/eea/volto-eea-website-theme/commit/7bc9da2cd837ab62a95cd29979cdd9b0055b7d67)]
|
|
1336
1327
|
### [1.3.1](https://github.com/eea/volto-eea-website-theme/compare/1.3.0...1.3.1) - 28 November 2022
|
|
@@ -1341,7 +1332,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1341
1332
|
|
|
1342
1333
|
#### :hammer_and_wrench: Others
|
|
1343
1334
|
|
|
1344
|
-
- yarn 3 [Alin Voinea - [`ea7a709`](https://github.com/eea/volto-eea-website-theme/commit/ea7a7094945312776e9b6f44e371178603e92139)]
|
|
1345
1335
|
### [1.3.0](https://github.com/eea/volto-eea-website-theme/compare/1.2.0...1.3.0) - 22 November 2022
|
|
1346
1336
|
|
|
1347
1337
|
#### :rocket: New Features
|
|
@@ -1382,7 +1372,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1382
1372
|
- Add subsite class to body [Tiberiu Ichim - [`74d700f`](https://github.com/eea/volto-eea-website-theme/commit/74d700fbfd6249a8604762a7e4e49cce857db0f3)]
|
|
1383
1373
|
- Add subsite info to header [Tiberiu Ichim - [`47daf8b`](https://github.com/eea/volto-eea-website-theme/commit/47daf8bb6374a1222040626b19d4154df7ba1b83)]
|
|
1384
1374
|
- fix eslint [Miu Razvan - [`eb8d0a7`](https://github.com/eea/volto-eea-website-theme/commit/eb8d0a790bc70c0aae256c6ff35f63c4885f338e)]
|
|
1385
|
-
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`cc578a4`](https://github.com/eea/volto-eea-website-theme/commit/cc578a413b205a8e61e091fab3a88f94cedefc89)]
|
|
1386
1375
|
### [1.1.0](https://github.com/eea/volto-eea-website-theme/compare/1.0.0...1.1.0) - 28 October 2022
|
|
1387
1376
|
|
|
1388
1377
|
#### :nail_care: Enhancements
|
|
@@ -1430,7 +1419,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1430
1419
|
|
|
1431
1420
|
#### :hammer_and_wrench: Others
|
|
1432
1421
|
|
|
1433
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`33b56ac`](https://github.com/eea/volto-eea-website-theme/commit/33b56acb13fbaf0c5b79e8fc6e13c4b699c79c90)]
|
|
1434
1422
|
### [0.7.3](https://github.com/eea/volto-eea-website-theme/compare/0.7.2...0.7.3) - 22 September 2022
|
|
1435
1423
|
|
|
1436
1424
|
#### :hammer_and_wrench: Others
|
|
@@ -1698,7 +1686,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1698
1686
|
- Header refactor, add custom logo #5 [ichim-david - [`4950235`](https://github.com/eea/volto-eea-website-theme/commit/49502358105437cfeac3b144e6d301cb59aa2346)]
|
|
1699
1687
|
- Update footer.config with new publication card component [ichim-david - [`2e38e9a`](https://github.com/eea/volto-eea-website-theme/commit/2e38e9a417f835009d60c80d4eb4b30229f55e45)]
|
|
1700
1688
|
- feature(breadcrumbs): implement eea-design-system breadcrumb as Volto component #32 #7 [ichim-david - [`181af41`](https://github.com/eea/volto-eea-website-theme/commit/181af4125ce2b9ddac56dab4723cb11c26633221)]
|
|
1701
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`da8ceb6`](https://github.com/eea/volto-eea-website-theme/commit/da8ceb68ea68bfbc9504e48ccd4d68277f11ab9a)]
|
|
1702
1689
|
- use breadcrumbs from eea-design-system [nileshgulia1 - [`db2f9e9`](https://github.com/eea/volto-eea-website-theme/commit/db2f9e9a4327420a3cce9a9903cd88549b129eab)]
|
|
1703
1690
|
- Update theme.config [ichim-david - [`8eca4f4`](https://github.com/eea/volto-eea-website-theme/commit/8eca4f40397a4aeca6d39029c92db78968d37064)]
|
|
1704
1691
|
- Added keyContent component to theme.config [ichim-david - [`d86f202`](https://github.com/eea/volto-eea-website-theme/commit/d86f202d0274d839487a88b51cae9a0e899beb23)]
|
|
@@ -1740,5 +1727,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1740
1727
|
|
|
1741
1728
|
#### :hammer_and_wrench: Others
|
|
1742
1729
|
|
|
1743
|
-
- yarn bootstrap [Alin Voinea - [`6995e9e`](https://github.com/eea/volto-eea-website-theme/commit/6995e9e091f21fdbbdffa8a44fc0e2c626f6d46a)]
|
|
1744
1730
|
- Initial commit [Alin Voinea - [`6a9c03a`](https://github.com/eea/volto-eea-website-theme/commit/6a9c03a7cebe71ca87e82cf58c42904063e9d8d3)]
|
package/package.json
CHANGED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import ReactDOM from 'react-dom';
|
|
2
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
|
+
import { serializeNodesToText } from '@plone/volto-slate/editor/render';
|
|
4
|
+
import { Editor } from 'slate';
|
|
5
|
+
import {
|
|
6
|
+
getPreviousVoltoBlock,
|
|
7
|
+
getNextVoltoBlock,
|
|
8
|
+
mergeSlateWithBlockForward,
|
|
9
|
+
mergeSlateWithBlockBackward,
|
|
10
|
+
} from '@plone/volto-slate/utils/volto-blocks';
|
|
11
|
+
import {
|
|
12
|
+
isCursorAtBlockStart,
|
|
13
|
+
isCursorAtBlockEnd,
|
|
14
|
+
} from '@plone/volto-slate/utils/selection';
|
|
15
|
+
import { makeEditor } from '@plone/volto-slate/utils/editor';
|
|
16
|
+
import {
|
|
17
|
+
changeBlock,
|
|
18
|
+
deleteBlock,
|
|
19
|
+
getBlocksFieldname,
|
|
20
|
+
getBlocksLayoutFieldname,
|
|
21
|
+
} from '@plone/volto/helpers/Blocks/Blocks';
|
|
22
|
+
/**
|
|
23
|
+
* Joins the current block (which has an active Slate Editor)
|
|
24
|
+
* with the previous block, to make a single block.
|
|
25
|
+
*
|
|
26
|
+
* @param {Editor} editor
|
|
27
|
+
* @param {KeyboardEvent} event
|
|
28
|
+
*/
|
|
29
|
+
export function joinWithPreviousBlock({ editor, event }, intl) {
|
|
30
|
+
if (!isCursorAtBlockStart(editor)) return;
|
|
31
|
+
|
|
32
|
+
const blockProps = editor.getBlockProps();
|
|
33
|
+
const {
|
|
34
|
+
block,
|
|
35
|
+
index,
|
|
36
|
+
saveSlateBlockSelection,
|
|
37
|
+
onSelectBlock,
|
|
38
|
+
data,
|
|
39
|
+
properties,
|
|
40
|
+
onChangeField,
|
|
41
|
+
} = blockProps;
|
|
42
|
+
|
|
43
|
+
const blocksFieldname = getBlocksFieldname(properties);
|
|
44
|
+
const blocksLayoutFieldname = getBlocksLayoutFieldname(properties);
|
|
45
|
+
|
|
46
|
+
const prev = getPreviousVoltoBlock(index, properties);
|
|
47
|
+
if (!prev) return;
|
|
48
|
+
const [otherBlock = {}, otherBlockId] = prev;
|
|
49
|
+
|
|
50
|
+
// Don't join with required blocks
|
|
51
|
+
if (data?.required || otherBlock?.required) return;
|
|
52
|
+
|
|
53
|
+
// If the previous block is not a slate block (e.g., image), we can only
|
|
54
|
+
// handle the empty-block case (delete the current empty block and select
|
|
55
|
+
// the previous block). If the current block has text, we cannot merge
|
|
56
|
+
// text into a non-slate block, so let the default Slate behavior run.
|
|
57
|
+
// Without this guard, getBlockEndAsRange and mergeSlateWithBlockBackward
|
|
58
|
+
// crash because non-slate blocks have no `value` property. (#8347)
|
|
59
|
+
if (otherBlock['@type'] !== 'slate') {
|
|
60
|
+
const text = Editor.string(editor, []);
|
|
61
|
+
if (text) return; // let default behavior handle it
|
|
62
|
+
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
const newFormData = deleteBlock(properties, block, intl);
|
|
66
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
67
|
+
onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
68
|
+
onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
69
|
+
onSelectBlock(otherBlockId);
|
|
70
|
+
});
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
|
|
77
|
+
// If the Editor contains no characters TODO: clarify if this special case
|
|
78
|
+
// really needs to be handled or not. In `joinWithNextBlock` it is not
|
|
79
|
+
// handled.
|
|
80
|
+
const text = Editor.string(editor, []);
|
|
81
|
+
if (!text) {
|
|
82
|
+
const cursor = getBlockEndAsRange(otherBlock);
|
|
83
|
+
const newFormData = deleteBlock(properties, block, intl);
|
|
84
|
+
|
|
85
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
86
|
+
saveSlateBlockSelection(otherBlockId, cursor);
|
|
87
|
+
|
|
88
|
+
onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
89
|
+
onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
90
|
+
|
|
91
|
+
onSelectBlock(otherBlockId);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Else the editor contains characters, so we merge the current block's
|
|
98
|
+
// `editor` with the block before, `otherBlock`.
|
|
99
|
+
const cursor = mergeSlateWithBlockBackward(editor, otherBlock, event);
|
|
100
|
+
|
|
101
|
+
// Get the merged content from the editor
|
|
102
|
+
const merged = JSON.parse(JSON.stringify(editor.children));
|
|
103
|
+
|
|
104
|
+
// // TODO: don't remove undo history, etc Should probably save both undo
|
|
105
|
+
// // histories, so that the blocks are split, the undos can be restored??
|
|
106
|
+
|
|
107
|
+
// const cursor = getBlockEndAsRange(otherBlock);
|
|
108
|
+
|
|
109
|
+
const formData = changeBlock(properties, otherBlockId, {
|
|
110
|
+
'@type': 'slate', // TODO: use a constant specified in src/constants.js instead of 'slate'
|
|
111
|
+
value: merged,
|
|
112
|
+
plaintext: serializeNodesToText(merged || []),
|
|
113
|
+
});
|
|
114
|
+
const newFormData = deleteBlock(formData, block, intl);
|
|
115
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
116
|
+
saveSlateBlockSelection(otherBlockId, cursor);
|
|
117
|
+
onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
118
|
+
onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
119
|
+
onSelectBlock(otherBlockId);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Joins the current block (which has the cursor) with the next block to make a
|
|
127
|
+
* single block.
|
|
128
|
+
* @param {Editor} editor
|
|
129
|
+
* @param {KeyboardEvent} event
|
|
130
|
+
*/
|
|
131
|
+
export function joinWithNextBlock({ editor, event }, intl) {
|
|
132
|
+
if (!isCursorAtBlockEnd(editor)) return;
|
|
133
|
+
|
|
134
|
+
const blockProps = editor.getBlockProps();
|
|
135
|
+
const {
|
|
136
|
+
block,
|
|
137
|
+
index,
|
|
138
|
+
// saveSlateBlockSelection,
|
|
139
|
+
onSelectBlock,
|
|
140
|
+
data,
|
|
141
|
+
} = blockProps;
|
|
142
|
+
|
|
143
|
+
const { properties, onChangeField } = editor.getBlockProps();
|
|
144
|
+
const [otherBlock = {}, otherBlockId] = getNextVoltoBlock(index, properties);
|
|
145
|
+
|
|
146
|
+
if (!otherBlockId) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Don't join with required blocks
|
|
151
|
+
if (data?.required || otherBlock?.required || otherBlock['@type'] !== 'slate')
|
|
152
|
+
return;
|
|
153
|
+
|
|
154
|
+
event.stopPropagation();
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
|
|
157
|
+
const blocksFieldname = getBlocksFieldname(properties);
|
|
158
|
+
const blocksLayoutFieldname = getBlocksLayoutFieldname(properties);
|
|
159
|
+
|
|
160
|
+
// If next block is not a slate text block, do nothing
|
|
161
|
+
if (otherBlock['@type'] !== 'slate') {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const nextValue = otherBlock?.value;
|
|
166
|
+
const nextPlaintext =
|
|
167
|
+
otherBlock?.plaintext ?? serializeNodesToText(nextValue || []);
|
|
168
|
+
// Treat the next block as empty if both its structured value and plaintext representation
|
|
169
|
+
// indicate no content. In that case we can delete it instead of attempting a merge.
|
|
170
|
+
const isEmptySlateBlock =
|
|
171
|
+
!Array.isArray(nextValue) ||
|
|
172
|
+
nextValue.length === 0 ||
|
|
173
|
+
!nextPlaintext ||
|
|
174
|
+
nextPlaintext.trim().length === 0;
|
|
175
|
+
|
|
176
|
+
if (isEmptySlateBlock) {
|
|
177
|
+
const newFormData = deleteBlock(properties, otherBlockId, intl);
|
|
178
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
179
|
+
onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
180
|
+
onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
181
|
+
onSelectBlock(block);
|
|
182
|
+
});
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
// Merge next text block into current one and delete the next block
|
|
186
|
+
mergeSlateWithBlockForward(editor, otherBlock);
|
|
187
|
+
|
|
188
|
+
const combined = JSON.parse(JSON.stringify(editor.children));
|
|
189
|
+
|
|
190
|
+
const formData = changeBlock(properties, block, {
|
|
191
|
+
'@type': 'slate',
|
|
192
|
+
value: combined,
|
|
193
|
+
plaintext: serializeNodesToText(combined || []),
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const newFormData = deleteBlock(formData, otherBlockId, intl);
|
|
197
|
+
|
|
198
|
+
ReactDOM.unstable_batchedUpdates(() => {
|
|
199
|
+
onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
200
|
+
onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
201
|
+
onSelectBlock(block);
|
|
202
|
+
});
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {object} block The Volto object representing the configuration and
|
|
208
|
+
* contents of a Volto Block of type Slate Text.
|
|
209
|
+
* @returns {Range} The collapsed Slate Range that represents the last position
|
|
210
|
+
* the text cursor can take inside the given block.
|
|
211
|
+
*/
|
|
212
|
+
function getBlockEndAsRange(block) {
|
|
213
|
+
const { value } = block;
|
|
214
|
+
const location = [value.length - 1]; // adress of root node
|
|
215
|
+
const editor = { children: value };
|
|
216
|
+
const newEditor = makeEditor();
|
|
217
|
+
newEditor.children = cloneDeep(editor.children);
|
|
218
|
+
const path = Editor.last(newEditor, location)[1]; // last Node in the block
|
|
219
|
+
// The last Text node (leaf node) entry inside the path computed just above.
|
|
220
|
+
const [leaf, leafpath] = Editor.leaf(newEditor, path);
|
|
221
|
+
// The offset of the Points in the collapsed Range computed below:
|
|
222
|
+
const offset = (leaf.text || '').length;
|
|
223
|
+
|
|
224
|
+
return {
|
|
225
|
+
anchor: { path: leafpath, offset },
|
|
226
|
+
focus: { path: leafpath, offset },
|
|
227
|
+
};
|
|
228
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
--- node_modules/@plone/volto-slate/src/blocks/Text/keyboard/joinBlocks.js 2026-06-19 16:56:50.025195065 +0300
|
|
2
|
+
+++ src/addons/volto-eea-website-theme/src/customizations/@plone/volto-slate/blocks/Text/keyboard/joinBlocks.js 2026-06-24 18:24:23.816712188 +0300
|
|
3
|
+
@@ -50,6 +50,27 @@
|
|
4
|
+
// Don't join with required blocks
|
|
5
|
+
if (data?.required || otherBlock?.required) return;
|
|
6
|
+
|
|
7
|
+
+ // If the previous block is not a slate block (e.g., image), we can only
|
|
8
|
+
+ // handle the empty-block case (delete the current empty block and select
|
|
9
|
+
+ // the previous block). If the current block has text, we cannot merge
|
|
10
|
+
+ // text into a non-slate block, so let the default Slate behavior run.
|
|
11
|
+
+ // Without this guard, getBlockEndAsRange and mergeSlateWithBlockBackward
|
|
12
|
+
+ // crash because non-slate blocks have no `value` property. (#8347)
|
|
13
|
+
+ if (otherBlock['@type'] !== 'slate') {
|
|
14
|
+
+ const text = Editor.string(editor, []);
|
|
15
|
+
+ if (text) return; // let default behavior handle it
|
|
16
|
+
+
|
|
17
|
+
+ event.stopPropagation();
|
|
18
|
+
+ event.preventDefault();
|
|
19
|
+
+ const newFormData = deleteBlock(properties, block, intl);
|
|
20
|
+
+ ReactDOM.unstable_batchedUpdates(() => {
|
|
21
|
+
+ onChangeField(blocksFieldname, newFormData[blocksFieldname]);
|
|
22
|
+
+ onChangeField(blocksLayoutFieldname, newFormData[blocksLayoutFieldname]);
|
|
23
|
+
+ onSelectBlock(otherBlockId);
|
|
24
|
+
+ });
|
|
25
|
+
+ return true;
|
|
26
|
+
+ }
|
|
27
|
+
+
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Shadow patch for #8347: Guard joinWithPreviousBlock against non-slate
|
|
2
|
+
previous blocks (e.g., image). Without this, getBlockEndAsRange and
|
|
3
|
+
mergeSlateWithBlockBackward crash because non-slate blocks have no
|
|
4
|
+
`value` property. See:
|
|
5
|
+
|
|
6
|
+
- https://github.com/plone/volto/issues/8347
|
|
7
|
+
- https://github.com/plone/volto/pull/8355
|
|
8
|
+
|
|
9
|
+
Remove this shadow once a @plone/volto-slate release containing the fix
|
|
10
|
+
is published and the dependency is bumped in frontend/package.json.
|