@fluentui-react-native/menu 1.12.19 → 1.12.21
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.json +31 -1
- package/CHANGELOG.md +18 -2
- package/lib/MenuGroup/MenuGroup.d.ts.map +1 -1
- package/lib/MenuGroup/MenuGroup.js +16 -1
- package/lib/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroup/MenuGroup.d.ts.map +1 -1
- package/lib-commonjs/MenuGroup/MenuGroup.js +16 -1
- package/lib-commonjs/MenuGroup/MenuGroup.js.map +1 -1
- package/package.json +15 -15
- package/src/MenuGroup/MenuGroup.tsx +22 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/menu",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Fri,
|
|
5
|
+
"date": "Fri, 01 Mar 2024 20:32:26 GMT",
|
|
6
|
+
"version": "1.12.21",
|
|
7
|
+
"tag": "@fluentui-react-native/menu_v1.12.21",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ruaraki@microsoft.com",
|
|
12
|
+
"package": "@fluentui-react-native/menu",
|
|
13
|
+
"commit": "17c82b22513a177eaaee6941e5d4bbc2d2654030",
|
|
14
|
+
"comment": "Use workspace for version of local package"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 01 Mar 2024 01:04:35 GMT",
|
|
21
|
+
"version": "1.12.20",
|
|
22
|
+
"tag": "@fluentui-react-native/menu_v1.12.20",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "krsiler@microsoft.com",
|
|
27
|
+
"package": "@fluentui-react-native/menu",
|
|
28
|
+
"commit": "17974c7b86abaa7769834551ff5743691819c905",
|
|
29
|
+
"comment": "fix menu group accessibility"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Fri, 23 Feb 2024 03:22:29 GMT",
|
|
6
36
|
"version": "1.12.19",
|
|
7
37
|
"tag": "@fluentui-react-native/menu_v1.12.19",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/menu
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri,
|
|
3
|
+
This log was last generated on Fri, 01 Mar 2024 20:32:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.12.21
|
|
8
|
+
|
|
9
|
+
Fri, 01 Mar 2024 20:32:26 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Use workspace for version of local package (ruaraki@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 1.12.20
|
|
16
|
+
|
|
17
|
+
Fri, 01 Mar 2024 01:04:35 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- fix menu group accessibility (krsiler@microsoft.com)
|
|
22
|
+
|
|
7
23
|
## 1.12.19
|
|
8
24
|
|
|
9
|
-
Fri, 23 Feb 2024 03:
|
|
25
|
+
Fri, 23 Feb 2024 03:22:29 GMT
|
|
10
26
|
|
|
11
27
|
### Patches
|
|
12
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,SAAS,uOAwEpB,CAAC"}
|
|
@@ -17,6 +17,7 @@ export var MenuGroup = compose({
|
|
|
17
17
|
useRender: function (userProps, useSlots) {
|
|
18
18
|
var Slots = useSlots(userProps);
|
|
19
19
|
return function (final, children) {
|
|
20
|
+
var _a;
|
|
20
21
|
var mergedProps = __rest(mergeProps(userProps, final), []);
|
|
21
22
|
var itemPosition = 0;
|
|
22
23
|
var childrenWithSet = React.Children.toArray(children).map(function (child) {
|
|
@@ -37,7 +38,21 @@ export var MenuGroup = compose({
|
|
|
37
38
|
}
|
|
38
39
|
return child;
|
|
39
40
|
});
|
|
40
|
-
|
|
41
|
+
// Check if this MenuGroup has a MenuGroupHeader. If so, use the MenuGroupHeader
|
|
42
|
+
// as the accessibilityLabel for the MenuGroup.
|
|
43
|
+
var menuGroupHeader = React.Children.toArray(children).find(function (child) { return React.isValidElement(child) && child.type.displayName === 'MenuGroupHeader'; });
|
|
44
|
+
// On win32, in order for assistive technology to read a group, it must have a name which is why
|
|
45
|
+
// we use a string with a space as the default accessibilityLabel for MenuGroup.
|
|
46
|
+
// If an empty string was used, the group context would not be read.
|
|
47
|
+
var menuGroupA11yLabel = ' ';
|
|
48
|
+
if (menuGroupHeader && typeof menuGroupHeader.props.children === 'string') {
|
|
49
|
+
menuGroupA11yLabel = menuGroupHeader.props.children;
|
|
50
|
+
}
|
|
51
|
+
return (withSlots(Slots.root, __assign({}, mergedProps, (Platform.OS == 'win32' && {
|
|
52
|
+
accessible: true,
|
|
53
|
+
accessibilityRole: 'group',
|
|
54
|
+
accessibilityLabel: (_a = mergedProps.accessibilityLabel) !== null && _a !== void 0 ? _a : menuGroupA11yLabel,
|
|
55
|
+
})),
|
|
41
56
|
withSlots(Slots.contentWrapper
|
|
42
57
|
// avoid error that fires when props are passed into React.fragment
|
|
43
58
|
, __assign({}, (hasFocusZone && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.t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Group/MenuGroup.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,SAAS,uOAwEpB,CAAC"}
|
|
@@ -20,6 +20,7 @@ exports.MenuGroup = (0, framework_1.compose)({
|
|
|
20
20
|
useRender: function (userProps, useSlots) {
|
|
21
21
|
var Slots = useSlots(userProps);
|
|
22
22
|
return function (final, children) {
|
|
23
|
+
var _a;
|
|
23
24
|
var mergedProps = tslib_1.__rest((0, framework_1.mergeProps)(userProps, final), []);
|
|
24
25
|
var itemPosition = 0;
|
|
25
26
|
var childrenWithSet = react_1.default.Children.toArray(children).map(function (child) {
|
|
@@ -40,7 +41,21 @@ exports.MenuGroup = (0, framework_1.compose)({
|
|
|
40
41
|
}
|
|
41
42
|
return child;
|
|
42
43
|
});
|
|
43
|
-
|
|
44
|
+
// Check if this MenuGroup has a MenuGroupHeader. If so, use the MenuGroupHeader
|
|
45
|
+
// as the accessibilityLabel for the MenuGroup.
|
|
46
|
+
var menuGroupHeader = react_1.default.Children.toArray(children).find(function (child) { return react_1.default.isValidElement(child) && child.type.displayName === 'MenuGroupHeader'; });
|
|
47
|
+
// On win32, in order for assistive technology to read a group, it must have a name which is why
|
|
48
|
+
// we use a string with a space as the default accessibilityLabel for MenuGroup.
|
|
49
|
+
// If an empty string was used, the group context would not be read.
|
|
50
|
+
var menuGroupA11yLabel = ' ';
|
|
51
|
+
if (menuGroupHeader && typeof menuGroupHeader.props.children === 'string') {
|
|
52
|
+
menuGroupA11yLabel = menuGroupHeader.props.children;
|
|
53
|
+
}
|
|
54
|
+
return ((0, framework_1.withSlots)(Slots.root, tslib_1.__assign({}, mergedProps, (react_native_1.Platform.OS == 'win32' && {
|
|
55
|
+
accessible: true,
|
|
56
|
+
accessibilityRole: 'group',
|
|
57
|
+
accessibilityLabel: (_a = mergedProps.accessibilityLabel) !== null && _a !== void 0 ? _a : menuGroupA11yLabel,
|
|
58
|
+
})),
|
|
44
59
|
(0, framework_1.withSlots)(Slots.contentWrapper
|
|
45
60
|
// avoid error that fires when props are passed into React.fragment
|
|
46
61
|
, tslib_1.__assign({}, (hasFocusZone && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":";;;;AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,wDAA0B;AAC1B,6CAA8C;AAE9C,gEAA8D;AAC9D,8DAAkF;AAIlF,qDAAkD;AAElD,mEAAmE;AACnE,IAAM,YAAY,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,uBAAQ,CAAC,EAAY,CAAC,CAAC;AAElD,QAAA,SAAS,GAAG,IAAA,mBAAO,EAAgB;IAC9C,WAAW,EAAE,+BAAa;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,mBAAI;QACV,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,sBAAS,CAAC,CAAC,CAAC,eAAK,CAAC,QAAQ;KAC1D;IACD,SAAS,EAAE,UAAC,SAAyB,EAAE,QAAiC;QACtE,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;QAClC,OAAO,UAAC,KAAqB,EAAE,QAAyB
|
|
1
|
+
{"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["../../src/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":";;;;AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,wDAA0B;AAC1B,6CAA8C;AAE9C,gEAA8D;AAC9D,8DAAkF;AAIlF,qDAAkD;AAElD,mEAAmE;AACnE,IAAM,YAAY,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,uBAAQ,CAAC,EAAY,CAAC,CAAC;AAElD,QAAA,SAAS,GAAG,IAAA,mBAAO,EAAgB;IAC9C,WAAW,EAAE,+B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ACT,CAAC;iBACH;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;YAEH,gFAAgF;YAChF,+CAA+C;YAC/C,IAAM,eAAe,GAAG,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC3D,UAAC,KAAK,IAAK,OAAA,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAK,KAAa,CAAC,IAAI,CAAC,WAAW,KAAK,iBAAiB,EAApF,CAAoF,CAChG,CAAC;YAEF,gGAAgG;YAChG,gFAAgF;YAChF,oEAAoE;YACpE,IAAI,kBAAkB,GAAG,GAAG,CAAC;YAC7B,IAAI,eAAe,IAAI,OAAQ,eAAsC,CAAC,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;gBACjG,kBAAkB,GAAI,eAAsC,CAAC,KAAK,CAAC,QAAQ,CAAC;aAC7E;YAED,OAAO,CACL,2BAAC,KAAK,CAAC,IAAI,uBACL,WAAW,EACX,CAAC,uBAAQ,CAAC,EAAE,IAAK,OAAe,IAAI;gBACtC,UAAU,EAAE,IAAI;gBAChB,iBAAiB,EAAE,OAAc;gBACjC,kBAAkB,EAAE,MAAA,WAAW,CAAC,kBAAkB,mCAAI,kBAAkB;aACzE,CAAC;gBAEF,2BAAC,KAAK,CAAC,cAAc;gBACnB,mEAAmE;uCAC/D,CAAC,YAAY,IAAI;oBACnB,kBAAkB,EAAE,UAAU;oBAC9B,eAAe,EAAE,KAAK;oBACtB,aAAa,EAAE,kBAAkB;iBAClC,CAAC,GAED,eAAe,CACK,CACZ,CACd,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/menu",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.21",
|
|
4
4
|
"description": "A cross-platform Menu component using the Fluent Design System",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"directory": "packages/components/menu"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@fluentui-react-native/adapters": "
|
|
26
|
-
"@fluentui-react-native/callout": "
|
|
27
|
-
"@fluentui-react-native/focus-zone": "
|
|
28
|
-
"@fluentui-react-native/framework": "0.13.
|
|
29
|
-
"@fluentui-react-native/icon": "
|
|
30
|
-
"@fluentui-react-native/interactive-hooks": "
|
|
31
|
-
"@fluentui-react-native/text": "
|
|
32
|
-
"@fluentui-react-native/theme-tokens": "
|
|
33
|
-
"@fluentui-react-native/tokens": "
|
|
34
|
-
"@fluentui-react-native/use-styling": "
|
|
25
|
+
"@fluentui-react-native/adapters": "0.12.1",
|
|
26
|
+
"@fluentui-react-native/callout": "0.25.11",
|
|
27
|
+
"@fluentui-react-native/focus-zone": "0.16.10",
|
|
28
|
+
"@fluentui-react-native/framework": "0.13.8",
|
|
29
|
+
"@fluentui-react-native/icon": "0.20.11",
|
|
30
|
+
"@fluentui-react-native/interactive-hooks": "0.26.1",
|
|
31
|
+
"@fluentui-react-native/text": "0.22.10",
|
|
32
|
+
"@fluentui-react-native/theme-tokens": "0.26.7",
|
|
33
|
+
"@fluentui-react-native/tokens": "0.22.7",
|
|
34
|
+
"@fluentui-react-native/use-styling": "0.12.1",
|
|
35
35
|
"tslib": "^2.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fluentui-react-native/button": "
|
|
39
|
-
"@fluentui-react-native/eslint-config-rules": "
|
|
40
|
-
"@fluentui-react-native/scripts": "
|
|
41
|
-
"@fluentui-react-native/test-tools": "
|
|
38
|
+
"@fluentui-react-native/button": "0.36.13",
|
|
39
|
+
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
40
|
+
"@fluentui-react-native/scripts": "0.1.1",
|
|
41
|
+
"@fluentui-react-native/test-tools": "0.1.1",
|
|
42
42
|
"@office-iss/react-native-win32": "^0.72.0",
|
|
43
43
|
"@react-native/metro-config": "^0.72.0",
|
|
44
44
|
"react": "18.2.0",
|
|
@@ -48,8 +48,29 @@ export const MenuGroup = compose<MenuGroupType>({
|
|
|
48
48
|
return child;
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
// Check if this MenuGroup has a MenuGroupHeader. If so, use the MenuGroupHeader
|
|
52
|
+
// as the accessibilityLabel for the MenuGroup.
|
|
53
|
+
const menuGroupHeader = React.Children.toArray(children).find(
|
|
54
|
+
(child) => React.isValidElement(child) && (child as any).type.displayName === 'MenuGroupHeader',
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// On win32, in order for assistive technology to read a group, it must have a name which is why
|
|
58
|
+
// we use a string with a space as the default accessibilityLabel for MenuGroup.
|
|
59
|
+
// If an empty string was used, the group context would not be read.
|
|
60
|
+
let menuGroupA11yLabel = ' ';
|
|
61
|
+
if (menuGroupHeader && typeof (menuGroupHeader as React.ReactElement).props.children === 'string') {
|
|
62
|
+
menuGroupA11yLabel = (menuGroupHeader as React.ReactElement).props.children;
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
return (
|
|
52
|
-
<Slots.root
|
|
66
|
+
<Slots.root
|
|
67
|
+
{...mergedProps}
|
|
68
|
+
{...(Platform.OS == ('win32' as any) && {
|
|
69
|
+
accessible: true,
|
|
70
|
+
accessibilityRole: 'group' as any,
|
|
71
|
+
accessibilityLabel: mergedProps.accessibilityLabel ?? menuGroupA11yLabel,
|
|
72
|
+
})}
|
|
73
|
+
>
|
|
53
74
|
<Slots.contentWrapper
|
|
54
75
|
// avoid error that fires when props are passed into React.fragment
|
|
55
76
|
{...(hasFocusZone && {
|