volto-dropdownmenu 2.4.2 → 3.0.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 +15 -0
- package/README.md +4 -2
- package/babel.config.js +1 -1
- package/package.json +5 -5
- package/src/components/DropdownMenu.jsx +19 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,10 +4,25 @@ 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
|
+
#### [v3.0.0](https://github.com/collective/volto-dropdownmenu/compare/v2.4.3...v3.0.0)
|
|
8
|
+
|
|
9
|
+
- refactor: upgraded dependencies and babel config for volto 16 [`#27`](https://github.com/collective/volto-dropdownmenu/pull/27)
|
|
10
|
+
- fix: a11y handle dropdown navigation [`67e97c1`](https://github.com/collective/volto-dropdownmenu/commit/67e97c1947e6a392e82c3104b5797a9c7680812f)
|
|
11
|
+
- Release 2.4.3 [`3e30ff8`](https://github.com/collective/volto-dropdownmenu/commit/3e30ff8c11ff10c3408c72c3a39728714e76f5ba)
|
|
12
|
+
- chore: rollback 2.4.3 release [`07b437b`](https://github.com/collective/volto-dropdownmenu/commit/07b437b365aaabc5a05e4d7adb7086f50186b3bc)
|
|
13
|
+
|
|
14
|
+
#### [v2.4.3](https://github.com/collective/volto-dropdownmenu/compare/v2.4.2...v2.4.3)
|
|
15
|
+
|
|
16
|
+
> 31 August 2022
|
|
17
|
+
|
|
18
|
+
- fix: a11y handle dropdown navigation [`b8304c1`](https://github.com/collective/volto-dropdownmenu/commit/b8304c1990698e0c957679edadeb58a18ffc539d)
|
|
19
|
+
- Release 2.4.3 [`b0f92e7`](https://github.com/collective/volto-dropdownmenu/commit/b0f92e7af65952ae5bcff29bde97c3edb9edf6af)
|
|
20
|
+
|
|
7
21
|
#### [v2.4.2](https://github.com/collective/volto-dropdownmenu/compare/v2.4.1...v2.4.2)
|
|
8
22
|
|
|
9
23
|
> 25 May 2022
|
|
10
24
|
|
|
25
|
+
- Release 2.4.2 [`0cb2f7c`](https://github.com/collective/volto-dropdownmenu/commit/0cb2f7c2faf7735f44e9f37764c821f7b7ddd8b0)
|
|
11
26
|
- feat: added mobile-menu-opend class to body when mobile menu is opened [`659960c`](https://github.com/collective/volto-dropdownmenu/commit/659960c07782af2b0fe7d0686029bfea2ee0bac2)
|
|
12
27
|
|
|
13
28
|
#### [v2.4.1](https://github.com/collective/volto-dropdownmenu/compare/v2.4.0...v2.4.1)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# volto-dropdownmenu
|
|
2
2
|
|
|
3
|
-
Volto addon for a customizable dropdown menu.
|
|
3
|
+
Volto addon for a customizable dropdown menu.
|
|
4
4
|
Intended to be used with [collective.volto.dropdownmenu](https://github.com/collective/collective.volto.dropdownmenu)
|
|
5
5
|
|
|
6
6
|
To be used with mrs-developer, see [Volto docs](https://docs.voltocms.com/customizing/add-ons/) for further usage informations.
|
|
@@ -9,7 +9,9 @@ Created with [voltocli](https://github.com/nzambello/voltocli).
|
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
|
-
> If you
|
|
12
|
+
> If you are using Volto < 16, then use [v2.4.3](https://github.com/collective/volto-dropdownmenu/tree/v2.4.3)
|
|
13
|
+
>
|
|
14
|
+
> If you are using Volto < 12, then use [v1.3.0](https://github.com/collective/volto-dropdownmenu/tree/v1.3.0)
|
|
13
15
|
|
|
14
16
|
Simply load the addon in your project, then edit the configuration in `/controlpanel/dropdown-menu-settings`.
|
|
15
17
|
Example configuration to be saved in Plone [here](./menuConfigurationExample.json).
|
package/babel.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volto-dropdownmenu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Volto addon for a customizable dropdown menu",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": "https://github.com/collective/volto-dropdownmenu.git",
|
|
7
7
|
"author": "collective",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"
|
|
10
|
+
"@plone/scripts": "^2.0.0",
|
|
11
|
+
"release-it": "^14.10.1"
|
|
11
12
|
},
|
|
12
13
|
"scripts": {
|
|
13
14
|
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
|
|
14
15
|
"release": "release-it"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"react-outside-click-handler": "1.3.0"
|
|
18
|
-
"@plone/scripts": "*"
|
|
18
|
+
"react-outside-click-handler": "1.3.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@plone/volto": ">=
|
|
21
|
+
"@plone/volto": ">=16.0.0-alpha.38"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import { NavLink, useLocation } from 'react-router-dom';
|
|
3
3
|
import { defineMessages, useIntl } from 'react-intl';
|
|
4
4
|
import { Segment, Container, Icon, Grid, Button } from 'semantic-ui-react';
|
|
@@ -48,6 +48,24 @@ const DropdownMenu = ({ menu, open = false, closeMenu }) => {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const lastLinkEventListener = (e) => {
|
|
52
|
+
if (e.code === 'Tab') {
|
|
53
|
+
document
|
|
54
|
+
.querySelector(
|
|
55
|
+
'.dropdown-menu-wrapper.open button.dropdown-close-button',
|
|
56
|
+
)
|
|
57
|
+
.focus();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const links = document.querySelectorAll('.dropdown-menu-wrapper.open a');
|
|
63
|
+
const lastLink = links[links.length - 1];
|
|
64
|
+
if (lastLink) {
|
|
65
|
+
lastLink.addEventListener('keydown', lastLinkEventListener);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
51
69
|
return (
|
|
52
70
|
<div
|
|
53
71
|
className={cx('dropdown-menu-wrapper', {
|