@fluentui-react-native/menu 1.14.29 → 1.14.31
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 +15 -0
- package/CHANGELOG.md +9 -1
- package/lib/MenuList/MenuList.d.ts.map +1 -1
- package/lib/MenuList/MenuList.js +3 -20
- package/lib/MenuList/MenuList.js.map +1 -1
- package/lib/MenuList/MenuList.styling.d.ts.map +1 -1
- package/lib/MenuList/MenuList.styling.js +9 -2
- package/lib/MenuList/MenuList.styling.js.map +1 -1
- package/lib-commonjs/MenuList/MenuList.d.ts.map +1 -1
- package/lib-commonjs/MenuList/MenuList.js +2 -19
- package/lib-commonjs/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/MenuList/MenuList.styling.d.ts.map +1 -1
- package/lib-commonjs/MenuList/MenuList.styling.js +9 -2
- package/lib-commonjs/MenuList/MenuList.styling.js.map +1 -1
- package/package.json +9 -9
- package/src/MenuList/MenuList.styling.ts +12 -2
- package/src/MenuList/MenuList.tsx +3 -23
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/menu",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Tue, 22 Jul 2025 22:15:16 GMT",
|
|
6
|
+
"version": "1.14.30",
|
|
7
|
+
"tag": "@fluentui-react-native/menu_v1.14.30",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ruaraki@microsoft.com",
|
|
12
|
+
"package": "@fluentui-react-native/menu",
|
|
13
|
+
"commit": "86eabb9a4f1deddab3f75946d2003df16a691836",
|
|
14
|
+
"comment": "Fix gap tokens on MenuList"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
4
19
|
{
|
|
5
20
|
"date": "Thu, 17 Jul 2025 20:54:32 GMT",
|
|
6
21
|
"version": "1.14.28",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/menu
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Tue, 22 Jul 2025 22:15:16 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.14.30
|
|
8
|
+
|
|
9
|
+
Tue, 22 Jul 2025 22:15:16 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fix gap tokens on MenuList (ruaraki@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 1.14.28
|
|
8
16
|
|
|
9
17
|
Thu, 17 Jul 2025 20:54:32 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAUnF,eAAO,MAAM,cAAc,UAAW,MAAM,SAAS,aAAa,aAAa,aAAa,KAAG,OAE9F,CAAC;AAEF,eAAO,MAAM,QAAQ,+NA6EnB,CAAC"}
|
package/lib/MenuList/MenuList.js
CHANGED
|
@@ -3,29 +3,12 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Platform, ScrollView, View } from 'react-native';
|
|
5
5
|
import { FocusZone } from '@fluentui-react-native/focus-zone';
|
|
6
|
-
import { compose,
|
|
6
|
+
import { compose, withSlots } from '@fluentui-react-native/framework';
|
|
7
7
|
import { stylingSettings } from './MenuList.styling';
|
|
8
8
|
import { menuListName } from './MenuList.types';
|
|
9
9
|
import { useMenuList } from './useMenuList';
|
|
10
10
|
import { useMenuListContextValue } from './useMenuListContextValue';
|
|
11
11
|
import { MenuListProvider } from '../context/menuListContext';
|
|
12
|
-
const MenuStack = stagedComponent((props) => {
|
|
13
|
-
const { gap, ...rest } = props;
|
|
14
|
-
return (final, children) => {
|
|
15
|
-
if (gap && gap > 0 && children) {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
|
-
// @ts-ignore - GH:1684, fix typing error
|
|
18
|
-
children = React.Children.map(children, (child, index) => {
|
|
19
|
-
if (React.isValidElement(child) && index > 0) {
|
|
20
|
-
return React.cloneElement(child, mergeProps(child.props, { style: { marginTop: gap } }));
|
|
21
|
-
}
|
|
22
|
-
return child;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return withSlots(View, { ...mergeProps(rest, final) }, children);
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
MenuStack.displayName = 'MenuStack';
|
|
29
12
|
const shouldHaveFocusZone = ['macos', 'win32'].includes(Platform.OS);
|
|
30
13
|
const focusLandsOnContainer = Platform.OS === 'macos';
|
|
31
14
|
const hasCircularNavigation = Platform.OS === 'win32';
|
|
@@ -36,9 +19,9 @@ export const MenuList = compose({
|
|
|
36
19
|
displayName: menuListName,
|
|
37
20
|
...stylingSettings,
|
|
38
21
|
slots: {
|
|
39
|
-
root:
|
|
22
|
+
root: View,
|
|
40
23
|
scrollView: ScrollView,
|
|
41
|
-
focusZone: shouldHaveFocusZone ? FocusZone :
|
|
24
|
+
focusZone: shouldHaveFocusZone ? FocusZone : View,
|
|
42
25
|
},
|
|
43
26
|
useRender: (userProps, useSlots) => {
|
|
44
27
|
const menuList = useMenuList(userProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,E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CAAC,IAED,eAAe,CACA,CACA,CACT,CACd,CAAC;YAEF,OAAO,UAAC,gBAAgB,IAAC,KAAK,EAAE,oBAAoB,IAAG,OAAO,CAAoB,CAAC;QACrF,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.styling.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,CAAC,MAAM,cAAc,CAAC,EAAqB,CAAC;AAEzE,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"MenuList.styling.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,CAAC,MAAM,cAAc,CAAC,EAAqB,CAAC;AAEzE,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,CA2B/F,CAAC"}
|
|
@@ -12,11 +12,18 @@ export const stylingSettings = {
|
|
|
12
12
|
style: {
|
|
13
13
|
backgroundColor: tokens.backgroundColor,
|
|
14
14
|
display: 'flex',
|
|
15
|
+
gap: tokens.gap,
|
|
15
16
|
...layoutStyles.from(tokens, theme),
|
|
16
17
|
...(Platform.OS === 'android' && { borderRadius: tokens.borderRadius }),
|
|
17
18
|
},
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}), ['backgroundColor', 'borderRadius', 'gap', ...layoutStyles.keys]),
|
|
20
|
+
focusZone: buildProps((tokens) => ({
|
|
21
|
+
style: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
gap: tokens.gap,
|
|
25
|
+
},
|
|
26
|
+
}), ['gap']),
|
|
20
27
|
},
|
|
21
28
|
};
|
|
22
29
|
//# sourceMappingURL=MenuList.styling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,cAAc,GAA6B,CAAC,cAAc,CAAC,CAAC;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;IAC7C,MAAM,EAAE,cAAc;IACtB,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,CAAC,MAAsB,EAAE,KAAY,EAAE,EAAE,CAAC,CAAC;YACzC,KAAK,EAAE;gBACL,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,OAAO,EAAE,MAAM;gBACf,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;gBACnC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;aACxE;
|
|
1
|
+
{"version":3,"file":"MenuList.styling.js","sourceRoot":"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"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AAUnF,eAAO,MAAM,cAAc,UAAW,MAAM,SAAS,aAAa,aAAa,aAAa,KAAG,OAE9F,CAAC;AAEF,eAAO,MAAM,QAAQ,+NA6EnB,CAAC"}
|
|
@@ -13,23 +13,6 @@ const MenuList_types_1 = require("./MenuList.types");
|
|
|
13
13
|
const useMenuList_1 = require("./useMenuList");
|
|
14
14
|
const useMenuListContextValue_1 = require("./useMenuListContextValue");
|
|
15
15
|
const menuListContext_1 = require("../context/menuListContext");
|
|
16
|
-
const MenuStack = (0, framework_1.stagedComponent)((props) => {
|
|
17
|
-
const { gap, ...rest } = props;
|
|
18
|
-
return (final, children) => {
|
|
19
|
-
if (gap && gap > 0 && children) {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
|
-
// @ts-ignore - GH:1684, fix typing error
|
|
22
|
-
children = react_1.default.Children.map(children, (child, index) => {
|
|
23
|
-
if (react_1.default.isValidElement(child) && index > 0) {
|
|
24
|
-
return react_1.default.cloneElement(child, (0, framework_1.mergeProps)(child.props, { style: { marginTop: gap } }));
|
|
25
|
-
}
|
|
26
|
-
return child;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return (0, framework_1.withSlots)(react_native_1.View, { ...(0, framework_1.mergeProps)(rest, final) }, children);
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
MenuStack.displayName = 'MenuStack';
|
|
33
16
|
const shouldHaveFocusZone = ['macos', 'win32'].includes(react_native_1.Platform.OS);
|
|
34
17
|
const focusLandsOnContainer = react_native_1.Platform.OS === 'macos';
|
|
35
18
|
const hasCircularNavigation = react_native_1.Platform.OS === 'win32';
|
|
@@ -41,9 +24,9 @@ exports.MenuList = (0, framework_1.compose)({
|
|
|
41
24
|
displayName: MenuList_types_1.menuListName,
|
|
42
25
|
...MenuList_styling_1.stylingSettings,
|
|
43
26
|
slots: {
|
|
44
|
-
root:
|
|
27
|
+
root: react_native_1.View,
|
|
45
28
|
scrollView: react_native_1.ScrollView,
|
|
46
|
-
focusZone: shouldHaveFocusZone ? focus_zone_1.FocusZone :
|
|
29
|
+
focusZone: shouldHaveFocusZone ? focus_zone_1.FocusZone : react_native_1.View,
|
|
47
30
|
},
|
|
48
31
|
useRender: (userProps, useSlots) => {
|
|
49
32
|
const menuList = (0, useMenuList_1.useMenuList)(userProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,0DAA0B;AAC1B,+CAA0D;
|
|
1
|
+
{"version":3,"file":"MenuList.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.tsx"],"names":[],"mappings":";;;;AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,0DAA0B;AAC1B,+CAA0D;AAE1D,kEAA8D;AAE9D,gEAAsE;AAEtE,yDAAqD;AAErD,qDAAgD;AAChD,+CAA4C;AAC5C,uEAAoE;AACpE,gEAA8D;AAE9D,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,uBAAQ,CAAC,EAAY,CAAC,CAAC;AAC/E,MAAM,qBAAqB,GAAG,uBAAQ,CAAC,EAAE,KAAK,OAAO,CAAC;AACtD,MAAM,qBAAqB,GAAG,uBAAQ,CAAC,EAAE,KAAM,OAAe,CAAC;AAExD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,KAAoB,EAAE,SAAwB,EAAW,EAAE;IACvG,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK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qB,IAAI,QAAQ,CAAC,YAAY;4BAC5D,kBAAkB,EAAE,UAAU;4BAC9B,sBAAsB,EAAE,qBAAqB,IAAI,QAAQ,CAAC,YAAY;4BACtE,eAAe,EAAE,KAAK;4BACtB,oBAAoB,EAAE,qBAAqB;4BAC3C,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;yBACvD,CAAC,IAED,eAAe,CACA,CACA,CACT,CACd,CAAC;YAEF,OAAO,2BAAC,kCAAgB,IAAC,KAAK,EAAE,oBAAoB,IAAG,OAAO,CAAoB,CAAC;QACrF,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.styling.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,CAAC,MAAM,cAAc,CAAC,EAAqB,CAAC;AAEzE,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"MenuList.styling.d.ts","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIjF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIzF,eAAO,MAAM,cAAc,EAAE,CAAC,MAAM,cAAc,CAAC,EAAqB,CAAC;AAEzE,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,CA2B/F,CAAC"}
|
|
@@ -15,11 +15,18 @@ exports.stylingSettings = {
|
|
|
15
15
|
style: {
|
|
16
16
|
backgroundColor: tokens.backgroundColor,
|
|
17
17
|
display: 'flex',
|
|
18
|
+
gap: tokens.gap,
|
|
18
19
|
...tokens_1.layoutStyles.from(tokens, theme),
|
|
19
20
|
...(react_native_1.Platform.OS === 'android' && { borderRadius: tokens.borderRadius }),
|
|
20
21
|
},
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
}), ['backgroundColor', 'borderRadius', 'gap', ...tokens_1.layoutStyles.keys]),
|
|
23
|
+
focusZone: (0, framework_1.buildProps)((tokens) => ({
|
|
24
|
+
style: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
gap: tokens.gap,
|
|
28
|
+
},
|
|
29
|
+
}), ['gap']),
|
|
23
30
|
},
|
|
24
31
|
};
|
|
25
32
|
//# sourceMappingURL=MenuList.styling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,gEAA8D;AAC9D,0DAA6D;AAG7D,qDAAgD;AAChD,qDAAyD;AAE5C,QAAA,cAAc,GAA6B,CAAC,cAAc,CAAC,CAAC;AAE5D,QAAA,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,sCAAqB,EAAE,6BAAY,CAAC;IAC7C,MAAM,EAAE,sBAAc;IACtB,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,CAAC,MAAsB,EAAE,KAAY,EAAE,EAAE,CAAC,CAAC;YACzC,KAAK,EAAE;gBACL,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,OAAO,EAAE,MAAM;gBACf,GAAG,qBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;gBACnC,GAAG,CAAC,uBAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;aACxE;
|
|
1
|
+
{"version":3,"file":"MenuList.styling.js","sourceRoot":"","sources":["../../src/MenuList/MenuList.styling.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,gEAA8D;AAC9D,0DAA6D;AAG7D,qDAAgD;AAChD,qDAAyD;AAE5C,QAAA,cAAc,GAA6B,CAAC,cAAc,CAAC,CAAC;AAE5D,QAAA,eAAe,GAAwE;IAClG,MAAM,EAAE,CAAC,sCAAqB,EAAE,6BAAY,CAAC;IAC7C,MAAM,EAAE,sBAAc;IACtB,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,CAAC,MAAsB,EAAE,KAAY,EAAE,EAAE,CAAC,CAAC;YACzC,KAAK,EAAE;gBACL,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,OAAO,EAAE,MAAM;gBACf,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,GAAG,qBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;gBACnC,GAAG,CAAC,uBAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;aACxE;SACF,CAAC,EACF,CAAC,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,qBAAY,CAAC,IAAI,CAAC,CACjE;QACD,SAAS,EAAE,IAAA,sBAAU,EACnB,CAAC,MAAsB,EAAE,EAAE,CAAC,CAAC;YAC3B,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;gBACvB,GAAG,EAAE,MAAM,CAAC,GAAG;aAChB;SACF,CAAC,EACF,CAAC,KAAK,CAAC,CACR;KACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/menu",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.31",
|
|
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",
|
|
@@ -31,21 +31,21 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@fluentui-react-native/adapters": "0.13.4",
|
|
34
|
-
"@fluentui-react-native/callout": "0.27.
|
|
35
|
-
"@fluentui-react-native/focus-zone": "0.21.
|
|
36
|
-
"@fluentui-react-native/framework": "0.14.
|
|
37
|
-
"@fluentui-react-native/icon": "0.21.
|
|
38
|
-
"@fluentui-react-native/interactive-hooks": "0.27.
|
|
39
|
-
"@fluentui-react-native/text": "0.24.
|
|
34
|
+
"@fluentui-react-native/callout": "0.27.9",
|
|
35
|
+
"@fluentui-react-native/focus-zone": "0.21.7",
|
|
36
|
+
"@fluentui-react-native/framework": "0.14.9",
|
|
37
|
+
"@fluentui-react-native/icon": "0.21.15",
|
|
38
|
+
"@fluentui-react-native/interactive-hooks": "0.27.11",
|
|
39
|
+
"@fluentui-react-native/text": "0.24.13",
|
|
40
40
|
"@fluentui-react-native/theme-tokens": "0.27.5",
|
|
41
41
|
"@fluentui-react-native/theming-utils": "0.26.5",
|
|
42
42
|
"@fluentui-react-native/tokens": "0.23.5",
|
|
43
|
-
"@fluentui-react-native/use-styling": "0.13.
|
|
43
|
+
"@fluentui-react-native/use-styling": "0.13.9",
|
|
44
44
|
"tslib": "^2.3.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/core": "^7.20.0",
|
|
48
|
-
"@fluentui-react-native/button": "0.39.
|
|
48
|
+
"@fluentui-react-native/button": "0.39.11",
|
|
49
49
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
50
50
|
"@fluentui-react-native/scripts": "0.1.1",
|
|
51
51
|
"@fluentui-react-native/test-tools": "0.1.1",
|
|
@@ -19,12 +19,22 @@ export const stylingSettings: UseStylingOptions<MenuListProps, MenuListSlotProps
|
|
|
19
19
|
style: {
|
|
20
20
|
backgroundColor: tokens.backgroundColor,
|
|
21
21
|
display: 'flex',
|
|
22
|
+
gap: tokens.gap,
|
|
22
23
|
...layoutStyles.from(tokens, theme),
|
|
23
24
|
...(Platform.OS === 'android' && { borderRadius: tokens.borderRadius }),
|
|
24
25
|
},
|
|
25
|
-
gap: tokens.gap,
|
|
26
26
|
}),
|
|
27
|
-
['backgroundColor', 'gap', ...layoutStyles.keys],
|
|
27
|
+
['backgroundColor', 'borderRadius', 'gap', ...layoutStyles.keys],
|
|
28
|
+
),
|
|
29
|
+
focusZone: buildProps(
|
|
30
|
+
(tokens: MenuListTokens) => ({
|
|
31
|
+
style: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
gap: tokens.gap,
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
['gap'],
|
|
28
38
|
),
|
|
29
39
|
},
|
|
30
40
|
};
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Platform, ScrollView, View } from 'react-native';
|
|
5
5
|
|
|
6
|
-
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
7
6
|
import { FocusZone } from '@fluentui-react-native/focus-zone';
|
|
8
7
|
import type { UseSlots } from '@fluentui-react-native/framework';
|
|
9
|
-
import { compose,
|
|
8
|
+
import { compose, withSlots } from '@fluentui-react-native/framework';
|
|
10
9
|
|
|
11
10
|
import { stylingSettings } from './MenuList.styling';
|
|
12
11
|
import type { MenuListProps, MenuListState, MenuListType } from './MenuList.types';
|
|
@@ -15,25 +14,6 @@ import { useMenuList } from './useMenuList';
|
|
|
15
14
|
import { useMenuListContextValue } from './useMenuListContextValue';
|
|
16
15
|
import { MenuListProvider } from '../context/menuListContext';
|
|
17
16
|
|
|
18
|
-
const MenuStack = stagedComponent((props: React.PropsWithRef<IViewProps> & { gap?: number }) => {
|
|
19
|
-
const { gap, ...rest } = props;
|
|
20
|
-
return (final: React.PropsWithRef<IViewProps> & { gap?: number }, children: React.ReactNode) => {
|
|
21
|
-
if (gap && gap > 0 && children) {
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
|
-
// @ts-ignore - GH:1684, fix typing error
|
|
24
|
-
children = React.Children.map(children, (child: React.ReactChild, index: number) => {
|
|
25
|
-
if (React.isValidElement(child) && index > 0) {
|
|
26
|
-
return React.cloneElement(child, mergeProps(child.props, { style: { marginTop: gap } }));
|
|
27
|
-
}
|
|
28
|
-
return child;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return <View {...mergeProps(rest, final)}>{children}</View>;
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
MenuStack.displayName = 'MenuStack';
|
|
36
|
-
|
|
37
17
|
const shouldHaveFocusZone = ['macos', 'win32'].includes(Platform.OS as string);
|
|
38
18
|
const focusLandsOnContainer = Platform.OS === 'macos';
|
|
39
19
|
const hasCircularNavigation = Platform.OS === ('win32' as any);
|
|
@@ -46,9 +26,9 @@ export const MenuList = compose<MenuListType>({
|
|
|
46
26
|
displayName: menuListName,
|
|
47
27
|
...stylingSettings,
|
|
48
28
|
slots: {
|
|
49
|
-
root:
|
|
29
|
+
root: View,
|
|
50
30
|
scrollView: ScrollView,
|
|
51
|
-
focusZone: shouldHaveFocusZone ? FocusZone :
|
|
31
|
+
focusZone: shouldHaveFocusZone ? FocusZone : View,
|
|
52
32
|
},
|
|
53
33
|
useRender: (userProps: MenuListProps, useSlots: UseSlots<MenuListType>) => {
|
|
54
34
|
const menuList = useMenuList(userProps);
|