cozy-ui 123.2.0 → 123.2.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.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [123.2.1](https://github.com/cozy/cozy-ui/compare/v123.2.0...v123.2.1) (2025-05-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Don't register Flagship UI on ActionsMenu until opened ([87def0d](https://github.com/cozy/cozy-ui/commit/87def0d))
|
|
7
|
+
|
|
1
8
|
# [123.2.0](https://github.com/cozy/cozy-ui/compare/v123.1.1...v123.2.0) (2025-05-15)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -8,6 +8,12 @@ import { useActionMenuEffects } from '../deprecated/ActionMenu/ActionMenuEffects
|
|
|
8
8
|
import isTesting from '../helpers/isTesting'
|
|
9
9
|
import useBreakpoints from '../providers/Breakpoints'
|
|
10
10
|
|
|
11
|
+
const ActionsMenuFlagshipUI = ({ children }) => {
|
|
12
|
+
useActionMenuEffects()
|
|
13
|
+
|
|
14
|
+
return children
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
const ActionsMenuWrapper = ({
|
|
12
18
|
children,
|
|
13
19
|
autoClose,
|
|
@@ -17,8 +23,6 @@ const ActionsMenuWrapper = ({
|
|
|
17
23
|
}) => {
|
|
18
24
|
const { isMobile } = useBreakpoints()
|
|
19
25
|
|
|
20
|
-
useActionMenuEffects()
|
|
21
|
-
|
|
22
26
|
const overrideClick = props => ev => {
|
|
23
27
|
props.onClick?.(ev) // this is ActionsItems onClick prop
|
|
24
28
|
autoClose && onClose?.()
|
|
@@ -26,19 +30,21 @@ const ActionsMenuWrapper = ({
|
|
|
26
30
|
|
|
27
31
|
if (isMobile && open) {
|
|
28
32
|
return (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
React.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
<ActionsMenuFlagshipUI>
|
|
34
|
+
<BottomSheet skipAnimation={isTesting()} backdrop onClose={onClose}>
|
|
35
|
+
<Paper square>
|
|
36
|
+
{React.Children.map(children, child =>
|
|
37
|
+
React.isValidElement(child)
|
|
38
|
+
? React.cloneElement(child, {
|
|
39
|
+
isListItem: true,
|
|
40
|
+
size: 'small',
|
|
41
|
+
onClick: overrideClick(child.props)
|
|
42
|
+
})
|
|
43
|
+
: null
|
|
44
|
+
)}
|
|
45
|
+
</Paper>
|
|
46
|
+
</BottomSheet>
|
|
47
|
+
</ActionsMenuFlagshipUI>
|
|
42
48
|
)
|
|
43
49
|
}
|
|
44
50
|
|
|
@@ -10,18 +10,22 @@ import { useActionMenuEffects } from "cozy-ui/transpiled/react/deprecated/Action
|
|
|
10
10
|
import isTesting from "cozy-ui/transpiled/react/helpers/isTesting";
|
|
11
11
|
import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
var children = _ref.children
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
var ActionsMenuFlagshipUI = function ActionsMenuFlagshipUI(_ref) {
|
|
14
|
+
var children = _ref.children;
|
|
15
|
+
useActionMenuEffects();
|
|
16
|
+
return children;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var ActionsMenuWrapper = function ActionsMenuWrapper(_ref2) {
|
|
20
|
+
var children = _ref2.children,
|
|
21
|
+
autoClose = _ref2.autoClose,
|
|
22
|
+
open = _ref2.open,
|
|
23
|
+
onClose = _ref2.onClose,
|
|
24
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
19
25
|
|
|
20
26
|
var _useBreakpoints = useBreakpoints(),
|
|
21
27
|
isMobile = _useBreakpoints.isMobile;
|
|
22
28
|
|
|
23
|
-
useActionMenuEffects();
|
|
24
|
-
|
|
25
29
|
var overrideClick = function overrideClick(props) {
|
|
26
30
|
return function (ev) {
|
|
27
31
|
var _props$onClick;
|
|
@@ -33,7 +37,7 @@ var ActionsMenuWrapper = function ActionsMenuWrapper(_ref) {
|
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
if (isMobile && open) {
|
|
36
|
-
return /*#__PURE__*/React.createElement(BottomSheet, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(ActionsMenuFlagshipUI, null, /*#__PURE__*/React.createElement(BottomSheet, {
|
|
37
41
|
skipAnimation: isTesting(),
|
|
38
42
|
backdrop: true,
|
|
39
43
|
onClose: onClose
|
|
@@ -45,7 +49,7 @@ var ActionsMenuWrapper = function ActionsMenuWrapper(_ref) {
|
|
|
45
49
|
size: 'small',
|
|
46
50
|
onClick: overrideClick(child.props)
|
|
47
51
|
}) : null;
|
|
48
|
-
})));
|
|
52
|
+
}))));
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
return /*#__PURE__*/React.createElement(Menu, _extends({}, props, {
|