@expo/ui 58.0.28 → 58.0.29
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 +7 -0
- package/android/build.gradle +2 -2
- package/assets/check.xml +10 -0
- package/build/community/bottom-sheet/BottomSheet.ios.js +1 -0
- package/build/community/bottom-sheet/BottomSheet.ios.js.map +1 -1
- package/build/community/menu/MenuView.android.d.ts +1 -1
- package/build/community/menu/MenuView.android.js +188 -95
- package/build/community/menu/MenuView.android.js.map +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.module → 58.0.29/expo.modules.ui-58.0.29.module} +7 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.pom → 58.0.29/expo.modules.ui-58.0.29.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha512 +1 -0
- package/package.json +1 -1
- package/src/community/bottom-sheet/BottomSheet.ios.tsx +5 -2
- package/src/community/menu/MenuView.android.tsx +193 -107
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28-sources.jar → 58.0.29/expo.modules.ui-58.0.29-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28-sources.jar.md5 → 58.0.29/expo.modules.ui-58.0.29-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28-sources.jar.sha1 → 58.0.29/expo.modules.ui-58.0.29-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28-sources.jar.sha256 → 58.0.29/expo.modules.ui-58.0.29-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28-sources.jar.sha512 → 58.0.29/expo.modules.ui-58.0.29-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.aar → 58.0.29/expo.modules.ui-58.0.29.aar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.aar.md5 → 58.0.29/expo.modules.ui-58.0.29.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.aar.sha1 → 58.0.29/expo.modules.ui-58.0.29.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.aar.sha256 → 58.0.29/expo.modules.ui-58.0.29.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.28/expo.modules.ui-58.0.28.aar.sha512 → 58.0.29/expo.modules.ui-58.0.29.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [iOS] Fix text in a community `BottomSheet` without snap points not wrapping beside other views, such as an icon or a button. ([#53401](https://github.com/expo/expo/pull/53401) by [@mazenchami](https://github.com/mazenchami))
|
|
8
|
+
- [Android] The community `MenuView` now shows an action with a `state` as a selectable Material 3 Expressive menu item. A selected item has a leading check icon and a highlighted container. Before, it showed a "✓" text character after the label. An action with `displayInline` is now its own group, and a long menu scrolls. Leading icons are now 20 dp instead of 24 dp, to match the Material 3 menu item size. ([#53485](https://github.com/expo/expo/pull/53485) by [@benjaminkomen](https://github.com/benjaminkomen))
|
|
9
|
+
|
|
3
10
|
## 58.0.28
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '58.0.
|
|
15
|
+
version = '58.0.29'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "58.0.
|
|
21
|
+
versionName "58.0.29"
|
|
22
22
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
23
23
|
}
|
|
24
24
|
buildFeatures {
|
package/assets/check.xml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
android:width="24dp"
|
|
3
|
+
android:height="24dp"
|
|
4
|
+
android:viewportWidth="960"
|
|
5
|
+
android:viewportHeight="960"
|
|
6
|
+
android:tint="?attr/colorControlNormal">
|
|
7
|
+
<path
|
|
8
|
+
android:fillColor="@android:color/white"
|
|
9
|
+
android:pathData="M382,720L154,492L211,435L382,606L749,239L806,296L382,720Z"/>
|
|
10
|
+
</vector>
|
|
@@ -232,6 +232,7 @@ function findNearestDetentIndex(detents, position) {
|
|
|
232
232
|
matchContents: fitToContents ? {
|
|
233
233
|
vertical: true
|
|
234
234
|
} : false,
|
|
235
|
+
boundedByHost: fitToContents,
|
|
235
236
|
children: /*#__PURE__*/ _jsx(View, {
|
|
236
237
|
style: fitToContents ? {
|
|
237
238
|
paddingTop: handleComponent !== null ? 16 : 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","requestedIndex","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","fitted","horizontal","vertical","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAGrE,SAASC,eAAeC,iBAAiB,QAAQ,6BAA6B;AAC9E,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAEEC,0BAA0B,EAC1BC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,EACzBC,kBAAkB,QACb,iDAAiD;AACxD,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,YAAY;AAC3E,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,SAASC,cAAc,QAAQ,UAAU;AAEzC,SAASC,cAAc,QAAQ,YAAY;AAE3C,kBAAkB;AAElB,SAASC,uBAAuBC,KAA2B;IACzD,IAAI,CAACA,OAAO,OAAOC;IACnB,MAAMC,OAAOnB,WAAWoB,OAAO,CAACH;IAChC,MAAMI,QAAQF,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E;wBAAM+F,WAAWA;kCAChB,cAAA,KAAC7F;
|
|
1
|
+
{"version":3,"sources":["community/bottom-sheet/BottomSheet.ios.tsx"],"sourcesContent":[null],"names":["useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","useWindowDimensions","View","StyleSheet","BottomSheet","NativeBottomSheet","Group","Host","RNHostView","interactiveDismissDisabled","presentationBackground","presentationDetents","presentationDragIndicator","presentationSizing","BottomSheetContext","BottomSheetInternalContext","SheetScrollContextReset","parseSnapPoint","useBottomSheet","extractBackgroundColor","style","undefined","flat","flatten","color","backgroundColor","snapPointToDetent","point","parsed","type","fraction","value","height","detentsAreEqual","a","b","findDetentIndex","detents","detent","findIndex","d","findNearestDetentIndex","position","nearestIndex","nearestDist","Infinity","forEach","i","pValue","dValue","dist","Math","abs","props","ref","snapPoints","snapPointsProp","index","indexProp","onChange","onClose","onDismiss","enablePanDownToClose","enableDynamicSizing","handleComponent","backgroundStyle","children","width","isPresented","setIsPresented","currentIndex","setCurrentIndex","max","currentIndexRef","closedRef","onChangeRef","current","onCloseRef","onDismissRef","length","map","selectedDetent","fitToContents","internalContextValue","fireCloseCallbacks","requestedIndex","clampedIndex","min","handlePresentedChange","presented","handleDetentChange","newIndex","methods","snapToIndex","close","snapToPosition","expand","collapse","forceClose","present","dismiss","modifiers","bg","fitted","horizontal","vertical","selection","onSelectionChange","Provider","pointerEvents","onIsPresentedChange","matchContents","boundedByHost","paddingTop","flexGrow"],"mappings":";AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC/F,SAASC,mBAAmB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,eAAe;AAGrE,SAASC,eAAeC,iBAAiB,QAAQ,6BAA6B;AAC9E,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,IAAI,QAAQ,sBAAsB;AAC3C,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAEEC,0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AAE;SAC3C;IACH,GAAG;QACDpB;QACA7C;QACA4C;QACAS;QACA1B;QACAF;QACAG;KACD;IAED,qBACE,KAAClD,2BAA2B6F,QAAQ;QAAC7E,OAAOoD;kBAC1C,cAAA,KAACrE,mBAAmB8F,QAAQ;YAAC7E,OAAO6D;sBAClC,cAAA,KAACrF;gBAAKa,OAAO;oBAAEsB,UAAU;oBAAYyB;gBAAM;gBAAG0C,eAAc;0BAC1D,cAAA,KAACxG;oBACC+D,aAAaA;oBACb0C,qBAAqBtB;oBACrB3B,WAAWuB;oBACXF,eAAeA;8BACf,cAAA,KAAC5E;wBAAM+F,WAAWA;kCAChB,cAAA,KAAC7F;4BACCuG,eAAe7B,gBAAgB;gCAAEuB,UAAU;4BAAK,IAAI;4BACpDO,eAAe9B;sCAOf,cAAA,KAAChF;gCACCkB,OACE8D,gBACI;oCAAE+B,YAAYjD,oBAAoB,OAAO,KAAK;gCAAE,IAChD;oCAAEkD,UAAU;oCAAGlF,QAAQ;oCAAGiF,YAAYjD,oBAAoB,OAAO,KAAK;gCAAE;0CAE9E,cAAA,KAAChD;8CAAyBkD;;;;;;;;;AAS5C"}
|
|
@@ -3,7 +3,7 @@ import type { MenuComponentProps, MenuComponentRef } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* A drop-in replacement for `@react-native-menu/menu` on Android.
|
|
5
5
|
* Wraps the trigger in a `Pressable` (whose `onPress`/`onLongPress` opens the menu) and
|
|
6
|
-
* renders the actions tree as a controlled Material `
|
|
6
|
+
* renders the actions tree as a controlled Material 3 Expressive `DropdownMenuPopup`.
|
|
7
7
|
*
|
|
8
8
|
* Note: when `action.image` is a string, it is treated as an iOS SF Symbol and ignored
|
|
9
9
|
* on Android — pass an `ImageSourcePropType` (e.g. `require('./icon.xml')`) to render
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Pressable, View } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Box } from '../../jetpack-compose/Box';
|
|
5
|
+
import { DropdownMenuGroup, DropdownMenuPopup, SelectableDropdownMenuItem } from '../../jetpack-compose/DropdownMenu';
|
|
6
6
|
import { DropdownMenuItem } from '../../jetpack-compose/DropdownMenu/DropdownMenuItem';
|
|
7
7
|
import { Host } from '../../jetpack-compose/Host';
|
|
8
8
|
import { Icon } from '../../jetpack-compose/Icon';
|
|
9
9
|
import { RNHostView } from '../../jetpack-compose/RNHostView';
|
|
10
|
+
import { Spacer } from '../../jetpack-compose/Spacer';
|
|
10
11
|
import { Text as ComposeText } from '../../jetpack-compose/Text';
|
|
11
12
|
import { useMaterialColors } from '../../jetpack-compose/colors';
|
|
13
|
+
import { height, verticalScroll } from '../../jetpack-compose/modifiers';
|
|
12
14
|
// Clipped popups drop the status bar offset, so edge-to-edge menus near the bottom detach from the anchor.
|
|
13
15
|
const POPUP_PROPERTIES = {
|
|
14
16
|
clippingEnabled: false
|
|
15
17
|
};
|
|
18
|
+
const CHECK_ICON = require('../../../assets/check.xml');
|
|
19
|
+
// Compose's `MenuDefaults.GroupSpacing`.
|
|
20
|
+
const MENU_GROUP_SPACING = 2;
|
|
21
|
+
// Compose's `MenuDefaults.LeadingIconSize`.
|
|
22
|
+
const MENU_ITEM_ICON_SIZE = 20;
|
|
16
23
|
function actionId(action) {
|
|
17
24
|
return action.id ?? action.title;
|
|
18
25
|
}
|
|
@@ -40,95 +47,179 @@ function buildElementColors(action, destructiveColor) {
|
|
|
40
47
|
disabledLeadingIconColor: leadingIconColor
|
|
41
48
|
};
|
|
42
49
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
50
|
+
function buildSelectableColors(action, destructiveColor) {
|
|
51
|
+
const colors = buildElementColors(action, destructiveColor);
|
|
52
|
+
if (colors == null) {
|
|
53
|
+
return undefined;
|
|
47
54
|
}
|
|
48
|
-
|
|
55
|
+
// A selected item keeps the destructive or custom colors instead of the selected-state colors.
|
|
56
|
+
return {
|
|
57
|
+
...colors,
|
|
58
|
+
selectedTextColor: colors.textColor,
|
|
59
|
+
selectedLeadingIconColor: colors.leadingIconColor
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Splits actions into the groups of a Material 3 Expressive menu. A `displayInline` action
|
|
64
|
+
* becomes a group of its own. Other actions that follow each other share a group.
|
|
65
|
+
*/ function groupActions(actions, keyPrefix = '') {
|
|
66
|
+
const groups = [];
|
|
67
|
+
let run = [];
|
|
68
|
+
// The key of a run of actions comes from the inline action before it, not from its first action.
|
|
69
|
+
// So the group does not remount, and an open submenu in it does not close, when an action hides.
|
|
70
|
+
let runKey = `${keyPrefix}^`;
|
|
71
|
+
for (const action of actions){
|
|
72
|
+
if (action.attributes?.hidden) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (action.displayInline && action.subactions && action.subactions.length > 0) {
|
|
76
|
+
if (run.length > 0) {
|
|
77
|
+
groups.push({
|
|
78
|
+
key: runKey,
|
|
79
|
+
actions: run
|
|
80
|
+
});
|
|
81
|
+
run = [];
|
|
82
|
+
}
|
|
83
|
+
const sectionKey = `${keyPrefix}${actionId(action)}`;
|
|
84
|
+
groups.push(...groupActions(action.subactions, `${sectionKey}/`));
|
|
85
|
+
runKey = `${sectionKey}$`;
|
|
86
|
+
} else {
|
|
87
|
+
run.push(action);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (run.length > 0) {
|
|
91
|
+
groups.push({
|
|
92
|
+
key: runKey,
|
|
93
|
+
actions: run
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return groups;
|
|
97
|
+
}
|
|
98
|
+
function MenuGroups({ actions, ...handlers }) {
|
|
99
|
+
const groups = groupActions(actions);
|
|
100
|
+
return groups.map((group, groupIndex)=>/*#__PURE__*/ _jsxs(React.Fragment, {
|
|
101
|
+
children: [
|
|
102
|
+
groupIndex > 0 && /*#__PURE__*/ _jsx(Spacer, {
|
|
103
|
+
modifiers: [
|
|
104
|
+
height(MENU_GROUP_SPACING)
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ _jsx(DropdownMenuGroup, {
|
|
108
|
+
shapes: {
|
|
109
|
+
index: groupIndex,
|
|
110
|
+
count: groups.length
|
|
111
|
+
},
|
|
112
|
+
children: group.actions.map((action, index)=>/*#__PURE__*/ _jsx(MenuActionItem, {
|
|
113
|
+
action: action,
|
|
114
|
+
shape: {
|
|
115
|
+
index,
|
|
116
|
+
count: group.actions.length
|
|
117
|
+
},
|
|
118
|
+
...handlers
|
|
119
|
+
}, actionId(action)))
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}, group.key));
|
|
123
|
+
}
|
|
124
|
+
function MenuActionItem({ action, shape, onPressAction, dismissAll, destructiveColor }) {
|
|
125
|
+
const [submenuExpanded, setSubmenuExpanded] = React.useState(false);
|
|
126
|
+
const { subactions, state, attributes, title, image, imageColor } = action;
|
|
49
127
|
// `image` is non-string only when caller passes an ImageSourcePropType
|
|
50
128
|
// (number from `require()` or `{ uri }`). The string form is iOS-only (SF Symbol).
|
|
51
129
|
const leadingIconSource = typeof image === 'string' || image == null ? null : image;
|
|
52
130
|
const elementColors = buildElementColors(action, destructiveColor);
|
|
131
|
+
const leadingIcon = leadingIconSource && /*#__PURE__*/ _jsx(Icon, {
|
|
132
|
+
source: leadingIconSource,
|
|
133
|
+
size: MENU_ITEM_ICON_SIZE,
|
|
134
|
+
tint: imageColor
|
|
135
|
+
});
|
|
53
136
|
if (subactions && subactions.length > 0) {
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
56
|
-
children: [
|
|
57
|
-
/*#__PURE__*/ _jsx(HorizontalDivider, {}),
|
|
58
|
-
subactions.map((sub)=>/*#__PURE__*/ _jsx(MenuActionItem, {
|
|
59
|
-
action: sub,
|
|
60
|
-
onPressAction: onPressAction,
|
|
61
|
-
dismissAll: dismissAll,
|
|
62
|
-
destructiveColor: destructiveColor
|
|
63
|
-
}, actionId(sub))),
|
|
64
|
-
/*#__PURE__*/ _jsx(HorizontalDivider, {})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return /*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
69
|
-
expanded: submenuExpanded,
|
|
70
|
-
onDismissRequest: ()=>setSubmenuExpanded(false),
|
|
71
|
-
properties: POPUP_PROPERTIES,
|
|
137
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
72
138
|
children: [
|
|
73
|
-
/*#__PURE__*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
leadingIconSource && /*#__PURE__*/ _jsx(DropdownMenuItem.LeadingIcon, {
|
|
85
|
-
children: /*#__PURE__*/ _jsx(Icon, {
|
|
86
|
-
source: leadingIconSource,
|
|
87
|
-
size: 24,
|
|
88
|
-
tint: imageColor
|
|
89
|
-
})
|
|
139
|
+
/*#__PURE__*/ _jsxs(DropdownMenuItem, {
|
|
140
|
+
enabled: !attributes?.disabled,
|
|
141
|
+
shape: shape,
|
|
142
|
+
elementColors: elementColors,
|
|
143
|
+
onClick: ()=>setSubmenuExpanded(true),
|
|
144
|
+
children: [
|
|
145
|
+
/*#__PURE__*/ _jsx(DropdownMenuItem.Text, {
|
|
146
|
+
children: /*#__PURE__*/ _jsx(ComposeText, {
|
|
147
|
+
children: title
|
|
90
148
|
})
|
|
91
|
-
|
|
149
|
+
}),
|
|
150
|
+
leadingIcon && /*#__PURE__*/ _jsx(DropdownMenuItem.LeadingIcon, {
|
|
151
|
+
children: leadingIcon
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ _jsx(DropdownMenuPopup, {
|
|
156
|
+
expanded: submenuExpanded,
|
|
157
|
+
onDismissRequest: ()=>setSubmenuExpanded(false),
|
|
158
|
+
anchorPosition: "end",
|
|
159
|
+
properties: POPUP_PROPERTIES,
|
|
160
|
+
// Unlike `DropdownMenu`, `DropdownMenuPopup` does not scroll a menu taller than the window.
|
|
161
|
+
modifiers: [
|
|
162
|
+
verticalScroll()
|
|
163
|
+
],
|
|
164
|
+
children: /*#__PURE__*/ _jsx(MenuGroups, {
|
|
165
|
+
actions: subactions,
|
|
166
|
+
onPressAction: onPressAction,
|
|
167
|
+
dismissAll: ()=>{
|
|
168
|
+
setSubmenuExpanded(false);
|
|
169
|
+
dismissAll();
|
|
170
|
+
},
|
|
171
|
+
destructiveColor: destructiveColor
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const onClick = ()=>{
|
|
178
|
+
onPressAction?.(makeEvent(action));
|
|
179
|
+
dismissAll();
|
|
180
|
+
};
|
|
181
|
+
// An action with a `state` is a choice. Compose gives a selected choice a highlighted container
|
|
182
|
+
// and `SelectedLeadingIcon`, which replaces the leading icon while the item is selected, and
|
|
183
|
+
// exposes the selected state to screen readers.
|
|
184
|
+
if (state != null) {
|
|
185
|
+
const colors = buildSelectableColors(action, destructiveColor);
|
|
186
|
+
return /*#__PURE__*/ _jsxs(SelectableDropdownMenuItem, {
|
|
187
|
+
selected: state === 'on',
|
|
188
|
+
enabled: !attributes?.disabled,
|
|
189
|
+
shapes: shape,
|
|
190
|
+
colors: colors,
|
|
191
|
+
onClick: onClick,
|
|
192
|
+
children: [
|
|
193
|
+
/*#__PURE__*/ _jsx(SelectableDropdownMenuItem.Text, {
|
|
194
|
+
children: /*#__PURE__*/ _jsx(ComposeText, {
|
|
195
|
+
children: title
|
|
92
196
|
})
|
|
93
197
|
}),
|
|
94
|
-
/*#__PURE__*/ _jsx(
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
destructiveColor: destructiveColor
|
|
103
|
-
}, actionId(sub)))
|
|
198
|
+
leadingIcon && /*#__PURE__*/ _jsx(SelectableDropdownMenuItem.LeadingIcon, {
|
|
199
|
+
children: leadingIcon
|
|
200
|
+
}),
|
|
201
|
+
/*#__PURE__*/ _jsx(SelectableDropdownMenuItem.SelectedLeadingIcon, {
|
|
202
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
203
|
+
source: CHECK_ICON,
|
|
204
|
+
size: MENU_ITEM_ICON_SIZE
|
|
205
|
+
})
|
|
104
206
|
})
|
|
105
207
|
]
|
|
106
208
|
});
|
|
107
209
|
}
|
|
108
210
|
return /*#__PURE__*/ _jsxs(DropdownMenuItem, {
|
|
109
211
|
enabled: !attributes?.disabled,
|
|
212
|
+
shape: shape,
|
|
110
213
|
elementColors: elementColors,
|
|
111
|
-
onClick:
|
|
112
|
-
onPressAction?.(makeEvent(action));
|
|
113
|
-
dismissAll();
|
|
114
|
-
},
|
|
214
|
+
onClick: onClick,
|
|
115
215
|
children: [
|
|
116
216
|
/*#__PURE__*/ _jsx(DropdownMenuItem.Text, {
|
|
117
217
|
children: /*#__PURE__*/ _jsx(ComposeText, {
|
|
118
218
|
children: title
|
|
119
219
|
})
|
|
120
220
|
}),
|
|
121
|
-
|
|
122
|
-
children:
|
|
123
|
-
source: leadingIconSource,
|
|
124
|
-
size: 24,
|
|
125
|
-
tint: imageColor
|
|
126
|
-
})
|
|
127
|
-
}),
|
|
128
|
-
state === 'on' && /*#__PURE__*/ _jsx(DropdownMenuItem.TrailingIcon, {
|
|
129
|
-
children: /*#__PURE__*/ _jsx(ComposeText, {
|
|
130
|
-
children: "✓"
|
|
131
|
-
})
|
|
221
|
+
leadingIcon && /*#__PURE__*/ _jsx(DropdownMenuItem.LeadingIcon, {
|
|
222
|
+
children: leadingIcon
|
|
132
223
|
})
|
|
133
224
|
]
|
|
134
225
|
});
|
|
@@ -136,7 +227,7 @@ function MenuActionItem({ action, onPressAction, dismissAll, destructiveColor })
|
|
|
136
227
|
/**
|
|
137
228
|
* A drop-in replacement for `@react-native-menu/menu` on Android.
|
|
138
229
|
* Wraps the trigger in a `Pressable` (whose `onPress`/`onLongPress` opens the menu) and
|
|
139
|
-
* renders the actions tree as a controlled Material `
|
|
230
|
+
* renders the actions tree as a controlled Material 3 Expressive `DropdownMenuPopup`.
|
|
140
231
|
*
|
|
141
232
|
* Note: when `action.image` is a string, it is treated as an iOS SF Symbol and ignored
|
|
142
233
|
* on Android — pass an `ImageSourcePropType` (e.g. `require('./icon.xml')`) to render
|
|
@@ -177,34 +268,36 @@ function MenuActionItem({ action, onPressAction, dismissAll, destructiveColor })
|
|
|
177
268
|
children: /*#__PURE__*/ _jsx(Host, {
|
|
178
269
|
colorScheme: colorScheme,
|
|
179
270
|
matchContents: true,
|
|
180
|
-
children: /*#__PURE__*/ _jsxs(
|
|
181
|
-
expanded: expanded,
|
|
182
|
-
onDismissRequest: dismissAll,
|
|
183
|
-
properties: POPUP_PROPERTIES,
|
|
271
|
+
children: /*#__PURE__*/ _jsxs(Box, {
|
|
184
272
|
children: [
|
|
185
|
-
/*#__PURE__*/ _jsx(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
children: children
|
|
198
|
-
})
|
|
273
|
+
/*#__PURE__*/ _jsx(RNHostView, {
|
|
274
|
+
matchContents: true,
|
|
275
|
+
children: /*#__PURE__*/ _jsx(Pressable, {
|
|
276
|
+
onPress: shouldOpenOnLongPress ? undefined : open,
|
|
277
|
+
onLongPress: shouldOpenOnLongPress ? open : undefined,
|
|
278
|
+
// Mirror upstream `@react-native-menu/menu`, which intercepts touches
|
|
279
|
+
// natively on a bare `ReactViewGroup`: no click sound, no focus
|
|
280
|
+
// highlight, no extra a11y node — children declare their own role.
|
|
281
|
+
android_disableSound: true,
|
|
282
|
+
focusable: false,
|
|
283
|
+
accessible: false,
|
|
284
|
+
children: children
|
|
199
285
|
})
|
|
200
286
|
}),
|
|
201
|
-
/*#__PURE__*/ _jsx(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
287
|
+
/*#__PURE__*/ _jsx(DropdownMenuPopup, {
|
|
288
|
+
expanded: expanded,
|
|
289
|
+
onDismissRequest: dismissAll,
|
|
290
|
+
properties: POPUP_PROPERTIES,
|
|
291
|
+
// Unlike `DropdownMenu`, `DropdownMenuPopup` does not scroll a menu taller than the window.
|
|
292
|
+
modifiers: [
|
|
293
|
+
verticalScroll()
|
|
294
|
+
],
|
|
295
|
+
children: /*#__PURE__*/ _jsx(MenuGroups, {
|
|
296
|
+
actions: actions,
|
|
297
|
+
onPressAction: onPressAction,
|
|
298
|
+
dismissAll: dismissAll,
|
|
299
|
+
destructiveColor: destructiveColor
|
|
300
|
+
})
|
|
208
301
|
})
|
|
209
302
|
]
|
|
210
303
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/menu/MenuView.android.tsx"],"sourcesContent":[null],"names":["React","Pressable","View","
|
|
1
|
+
{"version":3,"sources":["community/menu/MenuView.android.tsx"],"sourcesContent":[null],"names":["React","Pressable","View","Box","DropdownMenuGroup","DropdownMenuPopup","SelectableDropdownMenuItem","DropdownMenuItem","Host","Icon","RNHostView","Spacer","Text","ComposeText","useMaterialColors","height","verticalScroll","POPUP_PROPERTIES","clippingEnabled","CHECK_ICON","require","MENU_GROUP_SPACING","MENU_ITEM_ICON_SIZE","actionId","action","id","title","makeEvent","nativeEvent","event","buildElementColors","destructiveColor","isDestructive","attributes","destructive","textColor","titleColor","undefined","leadingIconColor","disabledTextColor","disabledLeadingIconColor","buildSelectableColors","colors","selectedTextColor","selectedLeadingIconColor","groupActions","actions","keyPrefix","groups","run","runKey","hidden","displayInline","subactions","length","push","key","sectionKey","MenuGroups","handlers","map","group","groupIndex","Fragment","modifiers","shapes","index","count","MenuActionItem","shape","onPressAction","dismissAll","submenuExpanded","setSubmenuExpanded","useState","state","image","imageColor","leadingIconSource","elementColors","leadingIcon","source","size","tint","enabled","disabled","onClick","LeadingIcon","expanded","onDismissRequest","anchorPosition","properties","selected","SelectedLeadingIcon","MenuView","props","ref","colorScheme","onOpenMenu","onCloseMenu","shouldOpenOnLongPress","style","children","testID","setExpanded","expandedRef","useRef","open","useCallback","current","useImperativeHandle","show","error","matchContents","onPress","onLongPress","android_disableSound","focusable","accessible"],"mappings":";AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAE/C,SAASC,GAAG,QAAQ,4BAA4B;AAChD,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,0BAA0B,QAGrB,qCAAqC;AAC5C,SACEC,gBAAgB,QAEX,sDAAsD;AAC7D,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAU,QAAQ,mCAAmC;AAC9D,SAASC,MAAM,QAAQ,+BAA+B;AACtD,SAASC,QAAQC,WAAW,QAAQ,6BAA6B;AACjE,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,SAASC,MAAM,EAAEC,cAAc,QAAQ,kCAAkC;AAIzE,2GAA2G;AAC3G,MAAMC,mBAAoC;IAAEC,iBAAiB;AAAM;AAEnE,MAAMC,aAAaC,QAAQ;AAE3B,yCAAyC;AACzC,MAAMC,qBAAqB;AAC3B,4CAA4C;AAC5C,MAAMC,sBAAsB;AAE5B,SAASC,SAASC,MAAkB;IAClC,OAAOA,OAAOC,EAAE,IAAID,OAAOE,KAAK;AAClC;AAEA,SAASC,UAAUH,MAAkB;IACnC,OAAO;QAAEI,aAAa;YAAEC,OAAON,SAASC;QAAQ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kCAGL,KAACjG;wBACCmF,UAAUA;wBACVC,kBAAkBlB;wBAClBoB,YAAY1E;wBACZ,4FAA4F;wBAC5F+C,WAAW;4BAAChD;yBAAiB;kCAC7B,cAAA,KAAC0C;4BACCZ,SAASA;4BACTwB,eAAeA;4BACfC,YAAYA;4BACZxC,kBAAkBA;;;;;;;AAOhC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "58.0.
|
|
6
|
+
"version": "58.0.29",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.ui-58.0.
|
|
28
|
-
"url": "expo.modules.ui-58.0.
|
|
27
|
+
"name": "expo.modules.ui-58.0.29.aar",
|
|
28
|
+
"url": "expo.modules.ui-58.0.29.aar",
|
|
29
29
|
"size": 2052964,
|
|
30
30
|
"sha512": "cd88b4525bfb3b18a00124846b8490508bf1d0dcdecd3364021f6337684d234cd712f701044ea86c752d6bebdbc2a037c473f579755d72183c3170b05d4da4aa",
|
|
31
31
|
"sha256": "e5e1c6db547749ec09478bfadaa4b1ed1a054a37ef3eed5c5d4272b7353ddef8",
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
],
|
|
142
142
|
"files": [
|
|
143
143
|
{
|
|
144
|
-
"name": "expo.modules.ui-58.0.
|
|
145
|
-
"url": "expo.modules.ui-58.0.
|
|
144
|
+
"name": "expo.modules.ui-58.0.29.aar",
|
|
145
|
+
"url": "expo.modules.ui-58.0.29.aar",
|
|
146
146
|
"size": 2052964,
|
|
147
147
|
"sha512": "cd88b4525bfb3b18a00124846b8490508bf1d0dcdecd3364021f6337684d234cd712f701044ea86c752d6bebdbc2a037c473f579755d72183c3170b05d4da4aa",
|
|
148
148
|
"sha256": "e5e1c6db547749ec09478bfadaa4b1ed1a054a37ef3eed5c5d4272b7353ddef8",
|
|
@@ -161,8 +161,8 @@
|
|
|
161
161
|
},
|
|
162
162
|
"files": [
|
|
163
163
|
{
|
|
164
|
-
"name": "expo.modules.ui-58.0.
|
|
165
|
-
"url": "expo.modules.ui-58.0.
|
|
164
|
+
"name": "expo.modules.ui-58.0.29-sources.jar",
|
|
165
|
+
"url": "expo.modules.ui-58.0.29-sources.jar",
|
|
166
166
|
"size": 128675,
|
|
167
167
|
"sha512": "02c22caa48a491ebbae97f797b9e0489f8df8383302341ae54c24a3745e1da294b175a3c30ee6884f3e70b5d992096e1e43ec06239f6151854fcd6658d63cc60",
|
|
168
168
|
"sha256": "5fe12f07a89cd50b36d822ff0e4a142c11f6f001daaf1786957b160bd9f03dea",
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a082cb150474f80301b97faf035028c8
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1195d7ad8c45b1a1b4c65331c2864559a574d8df
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5d7a86c0142faa658511616ea0359dd3539869c4f25747c8ff8662a2ed5063c7
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a53d2595b0800a308577ff51d08cfbefb766c4d43bbd2dd0cad3ed4d103f42c02d59b71af0d3f25c61f492e4faeb3c9468b9f138120497e5c2efd4d4a26e3a32
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.ui</groupId>
|
|
11
11
|
<artifactId>expo.modules.ui</artifactId>
|
|
12
|
-
<version>58.0.
|
|
12
|
+
<version>58.0.29</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.ui</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f54d43a71c217dbecf2ae138ae95cb19
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7a97506aba8ef835a876ffdcb9d4296e9fcefe2b
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6e89858c92d3cee04ff9157ceddec93a44b40f68e0e887fe31e0c8c47483024e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.29/expo.modules.ui-58.0.29.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bb3eae9a8b4291ec642b84f1d02ac176f08e407f0a25d221968ca3305c3815c8e5534025167bd9ac76017260b59aff6cf83914f15489a7530765dc344ed99494
|
package/package.json
CHANGED
|
@@ -236,12 +236,15 @@ export function BottomSheet(props: BottomSheetProps) {
|
|
|
236
236
|
onDismiss={fireCloseCallbacks}
|
|
237
237
|
fitToContents={fitToContents}>
|
|
238
238
|
<Group modifiers={modifiers}>
|
|
239
|
-
<RNHostView
|
|
239
|
+
<RNHostView
|
|
240
|
+
matchContents={fitToContents ? { vertical: true } : false}
|
|
241
|
+
boundedByHost={fitToContents}>
|
|
240
242
|
{/* paddingTop compensates for tighter spacing between native drag indicator and content
|
|
241
243
|
compared to gorhom's handle. flexGrow:1 + height:0 (flex-basis 0) fills the snap-point
|
|
242
244
|
height without inheriting the scrollable child's intrinsic content height. With matchContents,
|
|
243
245
|
RNHostView takes the width from the sheet, which can be narrower than the window, and
|
|
244
|
-
the height from the content.
|
|
246
|
+
the height from the content. The first measure runs before SwiftUI reports the sheet
|
|
247
|
+
width, so boundedByHost keeps it within the Host width. */}
|
|
245
248
|
<View
|
|
246
249
|
style={
|
|
247
250
|
fitToContents
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Pressable, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Box } from '../../jetpack-compose/Box';
|
|
5
|
+
import {
|
|
6
|
+
DropdownMenuGroup,
|
|
7
|
+
DropdownMenuPopup,
|
|
8
|
+
SelectableDropdownMenuItem,
|
|
9
|
+
type MenuShapePosition,
|
|
10
|
+
type SelectableDropdownMenuItemColors,
|
|
11
|
+
} from '../../jetpack-compose/DropdownMenu';
|
|
6
12
|
import {
|
|
7
13
|
DropdownMenuItem,
|
|
8
14
|
type DropdownMenuItemElementColors,
|
|
@@ -10,14 +16,23 @@ import {
|
|
|
10
16
|
import { Host } from '../../jetpack-compose/Host';
|
|
11
17
|
import { Icon } from '../../jetpack-compose/Icon';
|
|
12
18
|
import { RNHostView } from '../../jetpack-compose/RNHostView';
|
|
19
|
+
import { Spacer } from '../../jetpack-compose/Spacer';
|
|
13
20
|
import { Text as ComposeText } from '../../jetpack-compose/Text';
|
|
14
21
|
import { useMaterialColors } from '../../jetpack-compose/colors';
|
|
22
|
+
import { height, verticalScroll } from '../../jetpack-compose/modifiers';
|
|
15
23
|
import type { PopupProperties } from '../../types';
|
|
16
24
|
import type { MenuAction, MenuComponentProps, MenuComponentRef, NativeActionEvent } from './types';
|
|
17
25
|
|
|
18
26
|
// Clipped popups drop the status bar offset, so edge-to-edge menus near the bottom detach from the anchor.
|
|
19
27
|
const POPUP_PROPERTIES: PopupProperties = { clippingEnabled: false };
|
|
20
28
|
|
|
29
|
+
const CHECK_ICON = require('../../../assets/check.xml');
|
|
30
|
+
|
|
31
|
+
// Compose's `MenuDefaults.GroupSpacing`.
|
|
32
|
+
const MENU_GROUP_SPACING = 2;
|
|
33
|
+
// Compose's `MenuDefaults.LeadingIconSize`.
|
|
34
|
+
const MENU_ITEM_ICON_SIZE = 20;
|
|
35
|
+
|
|
21
36
|
function actionId(action: MenuAction): string {
|
|
22
37
|
return action.id ?? action.title;
|
|
23
38
|
}
|
|
@@ -47,103 +62,177 @@ function buildElementColors(
|
|
|
47
62
|
};
|
|
48
63
|
}
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
action: MenuAction
|
|
65
|
+
function buildSelectableColors(
|
|
66
|
+
action: MenuAction,
|
|
67
|
+
destructiveColor: string
|
|
68
|
+
): SelectableDropdownMenuItemColors | undefined {
|
|
69
|
+
const colors = buildElementColors(action, destructiveColor);
|
|
70
|
+
if (colors == null) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
// A selected item keeps the destructive or custom colors instead of the selected-state colors.
|
|
74
|
+
return {
|
|
75
|
+
...colors,
|
|
76
|
+
selectedTextColor: colors.textColor,
|
|
77
|
+
selectedLeadingIconColor: colors.leadingIconColor,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type MenuGroup = { key: string; actions: MenuAction[] };
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Splits actions into the groups of a Material 3 Expressive menu. A `displayInline` action
|
|
85
|
+
* becomes a group of its own. Other actions that follow each other share a group.
|
|
86
|
+
*/
|
|
87
|
+
function groupActions(actions: MenuAction[], keyPrefix = ''): MenuGroup[] {
|
|
88
|
+
const groups: MenuGroup[] = [];
|
|
89
|
+
let run: MenuAction[] = [];
|
|
90
|
+
// The key of a run of actions comes from the inline action before it, not from its first action.
|
|
91
|
+
// So the group does not remount, and an open submenu in it does not close, when an action hides.
|
|
92
|
+
let runKey = `${keyPrefix}^`;
|
|
93
|
+
for (const action of actions) {
|
|
94
|
+
if (action.attributes?.hidden) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (action.displayInline && action.subactions && action.subactions.length > 0) {
|
|
98
|
+
if (run.length > 0) {
|
|
99
|
+
groups.push({ key: runKey, actions: run });
|
|
100
|
+
run = [];
|
|
101
|
+
}
|
|
102
|
+
const sectionKey = `${keyPrefix}${actionId(action)}`;
|
|
103
|
+
groups.push(...groupActions(action.subactions, `${sectionKey}/`));
|
|
104
|
+
runKey = `${sectionKey}$`;
|
|
105
|
+
} else {
|
|
106
|
+
run.push(action);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (run.length > 0) {
|
|
110
|
+
groups.push({ key: runKey, actions: run });
|
|
111
|
+
}
|
|
112
|
+
return groups;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
type MenuHandlers = {
|
|
52
116
|
onPressAction: MenuComponentProps['onPressAction'];
|
|
53
117
|
dismissAll: () => void;
|
|
54
118
|
destructiveColor: string;
|
|
55
119
|
};
|
|
56
120
|
|
|
57
|
-
function
|
|
58
|
-
const
|
|
121
|
+
function MenuGroups({ actions, ...handlers }: MenuHandlers & { actions: MenuAction[] }) {
|
|
122
|
+
const groups = groupActions(actions);
|
|
123
|
+
return groups.map((group, groupIndex) => (
|
|
124
|
+
<React.Fragment key={group.key}>
|
|
125
|
+
{groupIndex > 0 && <Spacer modifiers={[height(MENU_GROUP_SPACING)]} />}
|
|
126
|
+
<DropdownMenuGroup shapes={{ index: groupIndex, count: groups.length }}>
|
|
127
|
+
{group.actions.map((action, index) => (
|
|
128
|
+
<MenuActionItem
|
|
129
|
+
key={actionId(action)}
|
|
130
|
+
action={action}
|
|
131
|
+
shape={{ index, count: group.actions.length }}
|
|
132
|
+
{...handlers}
|
|
133
|
+
/>
|
|
134
|
+
))}
|
|
135
|
+
</DropdownMenuGroup>
|
|
136
|
+
</React.Fragment>
|
|
137
|
+
));
|
|
138
|
+
}
|
|
59
139
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
140
|
+
function MenuActionItem({
|
|
141
|
+
action,
|
|
142
|
+
shape,
|
|
143
|
+
onPressAction,
|
|
144
|
+
dismissAll,
|
|
145
|
+
destructiveColor,
|
|
146
|
+
}: MenuHandlers & { action: MenuAction; shape: MenuShapePosition }) {
|
|
147
|
+
const [submenuExpanded, setSubmenuExpanded] = React.useState(false);
|
|
63
148
|
|
|
64
|
-
const { subactions,
|
|
149
|
+
const { subactions, state, attributes, title, image, imageColor } = action;
|
|
65
150
|
// `image` is non-string only when caller passes an ImageSourcePropType
|
|
66
151
|
// (number from `require()` or `{ uri }`). The string form is iOS-only (SF Symbol).
|
|
67
152
|
const leadingIconSource = typeof image === 'string' || image == null ? null : image;
|
|
68
153
|
const elementColors = buildElementColors(action, destructiveColor);
|
|
154
|
+
const leadingIcon = leadingIconSource && (
|
|
155
|
+
<Icon source={leadingIconSource} size={MENU_ITEM_ICON_SIZE} tint={imageColor} />
|
|
156
|
+
);
|
|
69
157
|
|
|
70
158
|
if (subactions && subactions.length > 0) {
|
|
71
|
-
if (displayInline) {
|
|
72
|
-
return (
|
|
73
|
-
<>
|
|
74
|
-
<HorizontalDivider />
|
|
75
|
-
{subactions.map((sub) => (
|
|
76
|
-
<MenuActionItem
|
|
77
|
-
key={actionId(sub)}
|
|
78
|
-
action={sub}
|
|
79
|
-
onPressAction={onPressAction}
|
|
80
|
-
dismissAll={dismissAll}
|
|
81
|
-
destructiveColor={destructiveColor}
|
|
82
|
-
/>
|
|
83
|
-
))}
|
|
84
|
-
<HorizontalDivider />
|
|
85
|
-
</>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
159
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
dismissAll
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
160
|
+
<Box>
|
|
161
|
+
<DropdownMenuItem
|
|
162
|
+
enabled={!attributes?.disabled}
|
|
163
|
+
shape={shape}
|
|
164
|
+
elementColors={elementColors}
|
|
165
|
+
onClick={() => setSubmenuExpanded(true)}>
|
|
166
|
+
<DropdownMenuItem.Text>
|
|
167
|
+
<ComposeText>{title}</ComposeText>
|
|
168
|
+
</DropdownMenuItem.Text>
|
|
169
|
+
{leadingIcon && (
|
|
170
|
+
<DropdownMenuItem.LeadingIcon>{leadingIcon}</DropdownMenuItem.LeadingIcon>
|
|
171
|
+
)}
|
|
172
|
+
</DropdownMenuItem>
|
|
173
|
+
<DropdownMenuPopup
|
|
174
|
+
expanded={submenuExpanded}
|
|
175
|
+
onDismissRequest={() => setSubmenuExpanded(false)}
|
|
176
|
+
anchorPosition="end"
|
|
177
|
+
properties={POPUP_PROPERTIES}
|
|
178
|
+
// Unlike `DropdownMenu`, `DropdownMenuPopup` does not scroll a menu taller than the window.
|
|
179
|
+
modifiers={[verticalScroll()]}>
|
|
180
|
+
<MenuGroups
|
|
181
|
+
actions={subactions}
|
|
182
|
+
onPressAction={onPressAction}
|
|
183
|
+
dismissAll={() => {
|
|
184
|
+
setSubmenuExpanded(false);
|
|
185
|
+
dismissAll();
|
|
186
|
+
}}
|
|
187
|
+
destructiveColor={destructiveColor}
|
|
188
|
+
/>
|
|
189
|
+
</DropdownMenuPopup>
|
|
190
|
+
</Box>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const onClick = () => {
|
|
195
|
+
onPressAction?.(makeEvent(action));
|
|
196
|
+
dismissAll();
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// An action with a `state` is a choice. Compose gives a selected choice a highlighted container
|
|
200
|
+
// and `SelectedLeadingIcon`, which replaces the leading icon while the item is selected, and
|
|
201
|
+
// exposes the selected state to screen readers.
|
|
202
|
+
if (state != null) {
|
|
203
|
+
const colors = buildSelectableColors(action, destructiveColor);
|
|
204
|
+
return (
|
|
205
|
+
<SelectableDropdownMenuItem
|
|
206
|
+
selected={state === 'on'}
|
|
207
|
+
enabled={!attributes?.disabled}
|
|
208
|
+
shapes={shape}
|
|
209
|
+
colors={colors}
|
|
210
|
+
onClick={onClick}>
|
|
211
|
+
<SelectableDropdownMenuItem.Text>
|
|
212
|
+
<ComposeText>{title}</ComposeText>
|
|
213
|
+
</SelectableDropdownMenuItem.Text>
|
|
214
|
+
{leadingIcon && (
|
|
215
|
+
<SelectableDropdownMenuItem.LeadingIcon>
|
|
216
|
+
{leadingIcon}
|
|
217
|
+
</SelectableDropdownMenuItem.LeadingIcon>
|
|
218
|
+
)}
|
|
219
|
+
<SelectableDropdownMenuItem.SelectedLeadingIcon>
|
|
220
|
+
<Icon source={CHECK_ICON} size={MENU_ITEM_ICON_SIZE} />
|
|
221
|
+
</SelectableDropdownMenuItem.SelectedLeadingIcon>
|
|
222
|
+
</SelectableDropdownMenuItem>
|
|
123
223
|
);
|
|
124
224
|
}
|
|
125
225
|
|
|
126
226
|
return (
|
|
127
227
|
<DropdownMenuItem
|
|
128
228
|
enabled={!attributes?.disabled}
|
|
229
|
+
shape={shape}
|
|
129
230
|
elementColors={elementColors}
|
|
130
|
-
onClick={
|
|
131
|
-
onPressAction?.(makeEvent(action));
|
|
132
|
-
dismissAll();
|
|
133
|
-
}}>
|
|
231
|
+
onClick={onClick}>
|
|
134
232
|
<DropdownMenuItem.Text>
|
|
135
233
|
<ComposeText>{title}</ComposeText>
|
|
136
234
|
</DropdownMenuItem.Text>
|
|
137
|
-
{
|
|
138
|
-
<DropdownMenuItem.LeadingIcon>
|
|
139
|
-
<Icon source={leadingIconSource} size={24} tint={imageColor} />
|
|
140
|
-
</DropdownMenuItem.LeadingIcon>
|
|
141
|
-
)}
|
|
142
|
-
{state === 'on' && (
|
|
143
|
-
<DropdownMenuItem.TrailingIcon>
|
|
144
|
-
<ComposeText>✓</ComposeText>
|
|
145
|
-
</DropdownMenuItem.TrailingIcon>
|
|
146
|
-
)}
|
|
235
|
+
{leadingIcon && <DropdownMenuItem.LeadingIcon>{leadingIcon}</DropdownMenuItem.LeadingIcon>}
|
|
147
236
|
</DropdownMenuItem>
|
|
148
237
|
);
|
|
149
238
|
}
|
|
@@ -151,7 +240,7 @@ function MenuActionItem({ action, onPressAction, dismissAll, destructiveColor }:
|
|
|
151
240
|
/**
|
|
152
241
|
* A drop-in replacement for `@react-native-menu/menu` on Android.
|
|
153
242
|
* Wraps the trigger in a `Pressable` (whose `onPress`/`onLongPress` opens the menu) and
|
|
154
|
-
* renders the actions tree as a controlled Material `
|
|
243
|
+
* renders the actions tree as a controlled Material 3 Expressive `DropdownMenuPopup`.
|
|
155
244
|
*
|
|
156
245
|
* Note: when `action.image` is a string, it is treated as an iOS SF Symbol and ignored
|
|
157
246
|
* on Android — pass an `ImageSourcePropType` (e.g. `require('./icon.xml')`) to render
|
|
@@ -198,37 +287,34 @@ export function MenuView(props: MenuComponentProps & { ref?: React.Ref<MenuCompo
|
|
|
198
287
|
return (
|
|
199
288
|
<View style={style} testID={testID}>
|
|
200
289
|
<Host colorScheme={colorScheme} matchContents>
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
))}
|
|
230
|
-
</DropdownMenu.Items>
|
|
231
|
-
</DropdownMenu>
|
|
290
|
+
<Box>
|
|
291
|
+
<RNHostView matchContents>
|
|
292
|
+
<Pressable
|
|
293
|
+
onPress={shouldOpenOnLongPress ? undefined : open}
|
|
294
|
+
onLongPress={shouldOpenOnLongPress ? open : undefined}
|
|
295
|
+
// Mirror upstream `@react-native-menu/menu`, which intercepts touches
|
|
296
|
+
// natively on a bare `ReactViewGroup`: no click sound, no focus
|
|
297
|
+
// highlight, no extra a11y node — children declare their own role.
|
|
298
|
+
android_disableSound
|
|
299
|
+
focusable={false}
|
|
300
|
+
accessible={false}>
|
|
301
|
+
{children}
|
|
302
|
+
</Pressable>
|
|
303
|
+
</RNHostView>
|
|
304
|
+
<DropdownMenuPopup
|
|
305
|
+
expanded={expanded}
|
|
306
|
+
onDismissRequest={dismissAll}
|
|
307
|
+
properties={POPUP_PROPERTIES}
|
|
308
|
+
// Unlike `DropdownMenu`, `DropdownMenuPopup` does not scroll a menu taller than the window.
|
|
309
|
+
modifiers={[verticalScroll()]}>
|
|
310
|
+
<MenuGroups
|
|
311
|
+
actions={actions}
|
|
312
|
+
onPressAction={onPressAction}
|
|
313
|
+
dismissAll={dismissAll}
|
|
314
|
+
destructiveColor={destructiveColor}
|
|
315
|
+
/>
|
|
316
|
+
</DropdownMenuPopup>
|
|
317
|
+
</Box>
|
|
232
318
|
</Host>
|
|
233
319
|
</View>
|
|
234
320
|
);
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5bc7180d3b779adb89e6298e7e945772
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e471c3dd6b76eb4d514d04c5f41bebf10722a3d0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f2fff604af4f027da7c666bf8e459a3b65c02cc819dca3b5497ad928becb6360
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
80ad822767f8aa3c98f8d101e4e42df22b728dc43ab96155f4d3c5f7588ac43959de6ee22b8132513eb75ec9017c12198250b6061c73f4f6c0389863993ac361
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e89e26acc7a2f85f7eb7f81570f2b70a
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
07d332fd0f7b1c97c43c519cc4afb9024feda4e5
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9daff28a5a17aaf88d2040936a8e15a773e16a8a2c985181a49cfad8575c8df8
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.28/expo.modules.ui-58.0.28.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
331d0d5ba59a44010eec7810012a3c65e3c6f823a0516a64d451b1381bd417065a973aa798e5f1be3a172c676a99110d6659d26d3dba8581b6302c3709b0d28f
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|