@react-native-menu/menu 1.1.5 → 1.1.7
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/README.md +15 -1
- package/android/build.gradle +40 -0
- package/android/src/main/java/com/reactnativemenu/MenuView.kt +41 -3
- package/android/src/main/java/com/reactnativemenu/{MenuViewManager.kt → MenuViewManagerBase.kt} +14 -8
- package/android/src/reactNativeVersionPatch/MenuViewManager/75/com/reactnativemenu/MenuViewManager.kt +17 -0
- package/android/src/reactNativeVersionPatch/MenuViewManager/latest/com/reactnativemenu/MenuViewManager.kt +14 -0
- package/ios/NewArch/FabricViewImplementationProtocol.swift +3 -0
- package/ios/NewArch/MenuView.mm +20 -0
- package/ios/Shared/ActionSheetView.swift +2 -2
- package/ios/Shared/MenuViewImplementation.swift +3 -3
- package/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.js +1 -1
- package/lib/commonjs/NativeModuleSpecs/UIMenuNativeComponent.js.map +1 -1
- package/lib/commonjs/UIMenuView.android.js +19 -1
- package/lib/commonjs/UIMenuView.android.js.map +1 -1
- package/lib/commonjs/UIMenuView.js +0 -3
- package/lib/commonjs/UIMenuView.js.map +1 -1
- package/lib/commonjs/index.js +6 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/NativeModuleSpecs/UIMenuNativeComponent.js +2 -2
- package/lib/module/NativeModuleSpecs/UIMenuNativeComponent.js.map +1 -1
- package/lib/module/UIMenuView.android.js +20 -2
- package/lib/module/UIMenuView.android.js.map +1 -1
- package/lib/module/UIMenuView.ios.js +1 -1
- package/lib/module/UIMenuView.js +1 -2
- package/lib/module/UIMenuView.js.map +1 -1
- package/lib/module/index.js +9 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts +10 -2
- package/lib/typescript/src/NativeModuleSpecs/UIMenuNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/UIMenuView.android.d.ts +2 -3
- package/lib/typescript/src/UIMenuView.android.d.ts.map +1 -1
- package/lib/typescript/src/UIMenuView.d.ts +2 -2
- package/lib/typescript/src/UIMenuView.d.ts.map +1 -1
- package/lib/typescript/src/UIMenuView.ios.d.ts +1 -1
- package/lib/typescript/src/index.d.ts +20 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +10 -6
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +10 -44
- package/src/NativeModuleSpecs/UIMenuNativeComponent.ts +45 -37
- package/src/UIMenuView.android.tsx +34 -4
- package/src/UIMenuView.ios.tsx +1 -1
- package/src/UIMenuView.tsx +11 -11
- package/src/index.tsx +32 -26
- package/src/types.ts +158 -153
- package/src/utils.ts +17 -17
package/README.md
CHANGED
|
@@ -40,14 +40,20 @@ npx pod-install
|
|
|
40
40
|
## Usage
|
|
41
41
|
|
|
42
42
|
```jsx
|
|
43
|
-
import { MenuView } from '@react-native-menu/menu';
|
|
43
|
+
import { MenuView, MenuComponentRef } from '@react-native-menu/menu';
|
|
44
44
|
|
|
45
45
|
// ...
|
|
46
46
|
|
|
47
47
|
const App = () => {
|
|
48
|
+
const menuRef = useRef<MenuComponentRef>(null);
|
|
48
49
|
return (
|
|
49
50
|
<View style={styles.container}>
|
|
51
|
+
<Button
|
|
52
|
+
title="Show Menu with ref (Android only)"
|
|
53
|
+
onPress={() => menuRef.current?.show()}
|
|
54
|
+
/>
|
|
50
55
|
<MenuView
|
|
56
|
+
ref={menuRef}
|
|
51
57
|
title="Menu Title"
|
|
52
58
|
onPressAction={({ nativeEvent }) => {
|
|
53
59
|
console.warn(JSON.stringify(nativeEvent));
|
|
@@ -131,6 +137,14 @@ It's also possible to obtain the `action` is a more React-ish, declarative fashi
|
|
|
131
137
|
|
|
132
138
|
### Props
|
|
133
139
|
|
|
140
|
+
#### `ref` (Android only)
|
|
141
|
+
|
|
142
|
+
Ref to the menu component.
|
|
143
|
+
|
|
144
|
+
| Type | Required |
|
|
145
|
+
|------|----------|
|
|
146
|
+
| ref | No |
|
|
147
|
+
|
|
134
148
|
### `title` (iOS only)
|
|
135
149
|
|
|
136
150
|
The title of the menu.
|
package/android/build.gradle
CHANGED
|
@@ -33,6 +33,10 @@ def getExtOrIntegerDefault(name) {
|
|
|
33
33
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Menu_" + name]).toInteger()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
def getExtOrFallback(name, fallback) {
|
|
37
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
def supportsNamespace() {
|
|
37
41
|
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
38
42
|
def major = parsed[0].toInteger()
|
|
@@ -42,6 +46,35 @@ def supportsNamespace() {
|
|
|
42
46
|
return (major == 7 && minor >= 3) || major >= 8
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
def resolveReactNativeDirectory() {
|
|
50
|
+
def reactNativeLocation = getExtOrFallback("REACT_NATIVE_NODE_MODULES_DIR", null)
|
|
51
|
+
if (reactNativeLocation != null) {
|
|
52
|
+
return file(reactNativeLocation)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// monorepo workaround.
|
|
56
|
+
def reactNativePackage = file(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim())
|
|
57
|
+
if(reactNativePackage.exists()) {
|
|
58
|
+
return reactNativePackage.parentFile
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
throw new GradleException(
|
|
62
|
+
"[@react-native-menu/menu] Unable to resolve react-native location in node_modules. You should project extension property (in `app/build.gradle`) `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native."
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
def getReactNativeMinorVersion() {
|
|
67
|
+
def REACT_NATIVE_DIR = resolveReactNativeDirectory()
|
|
68
|
+
|
|
69
|
+
def reactProperties = new Properties()
|
|
70
|
+
file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
|
|
71
|
+
|
|
72
|
+
def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME")
|
|
73
|
+
def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger()
|
|
74
|
+
|
|
75
|
+
return REACT_NATIVE_MINOR_VERSION
|
|
76
|
+
}
|
|
77
|
+
|
|
45
78
|
android {
|
|
46
79
|
if (supportsNamespace()) {
|
|
47
80
|
namespace "com.reactnativemenu"
|
|
@@ -93,6 +126,13 @@ android {
|
|
|
93
126
|
} else {
|
|
94
127
|
java.srcDirs += ["src/oldarch"]
|
|
95
128
|
}
|
|
129
|
+
|
|
130
|
+
// MenuViewManager
|
|
131
|
+
if (getReactNativeMinorVersion() <= 75) {
|
|
132
|
+
java.srcDirs += "src/reactNativeVersionPatch/MenuViewManager/75"
|
|
133
|
+
} else {
|
|
134
|
+
java.srcDirs += "src/reactNativeVersionPatch/MenuViewManager/latest"
|
|
135
|
+
}
|
|
96
136
|
}
|
|
97
137
|
}
|
|
98
138
|
}
|
|
@@ -3,6 +3,7 @@ package com.reactnativemenu
|
|
|
3
3
|
import android.content.res.ColorStateList
|
|
4
4
|
import android.content.res.Resources
|
|
5
5
|
import android.graphics.Color
|
|
6
|
+
import android.graphics.Rect
|
|
6
7
|
import android.os.Build
|
|
7
8
|
import android.text.Spannable
|
|
8
9
|
import android.text.SpannableStringBuilder
|
|
@@ -11,19 +12,18 @@ import android.view.*
|
|
|
11
12
|
import android.widget.PopupMenu
|
|
12
13
|
import com.facebook.react.bridge.*
|
|
13
14
|
import com.facebook.react.uimanager.UIManagerHelper
|
|
14
|
-
import com.facebook.react.uimanager.events.Event
|
|
15
|
-
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
16
15
|
import com.facebook.react.views.view.ReactViewGroup
|
|
17
16
|
import java.lang.reflect.Field
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
class MenuView(private val mContext: ReactContext): ReactViewGroup(mContext) {
|
|
19
|
+
class MenuView(private val mContext: ReactContext) : ReactViewGroup(mContext) {
|
|
21
20
|
private lateinit var mActions: ReadableArray
|
|
22
21
|
private var mIsAnchoredToRight = false
|
|
23
22
|
private val mPopupMenu: PopupMenu = PopupMenu(context, this)
|
|
24
23
|
private var mIsMenuDisplayed = false
|
|
25
24
|
private var mIsOnLongPress = false
|
|
26
25
|
private var mGestureDetector: GestureDetector
|
|
26
|
+
private var mHitSlopRect: Rect? = null
|
|
27
27
|
|
|
28
28
|
init {
|
|
29
29
|
mGestureDetector = GestureDetector(mContext, object : GestureDetector.SimpleOnGestureListener() {
|
|
@@ -43,6 +43,16 @@ class MenuView(private val mContext: ReactContext): ReactViewGroup(mContext) {
|
|
|
43
43
|
})
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
fun show(){
|
|
47
|
+
prepareMenu()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override fun setHitSlopRect(rect: Rect?) {
|
|
51
|
+
super.setHitSlopRect(rect)
|
|
52
|
+
mHitSlopRect = rect
|
|
53
|
+
updateTouchDelegate()
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
|
|
47
57
|
return true
|
|
48
58
|
}
|
|
@@ -52,6 +62,16 @@ class MenuView(private val mContext: ReactContext): ReactViewGroup(mContext) {
|
|
|
52
62
|
return true
|
|
53
63
|
}
|
|
54
64
|
|
|
65
|
+
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
|
66
|
+
super.onSizeChanged(w, h, oldw, oldh)
|
|
67
|
+
updateTouchDelegate()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
override fun onAttachedToWindow() {
|
|
71
|
+
super.onAttachedToWindow()
|
|
72
|
+
updateTouchDelegate()
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
override fun onDetachedFromWindow() {
|
|
56
76
|
super.onDetachedFromWindow()
|
|
57
77
|
if (mIsMenuDisplayed) {
|
|
@@ -247,6 +267,24 @@ class MenuView(private val mContext: ReactContext): ReactViewGroup(mContext) {
|
|
|
247
267
|
}
|
|
248
268
|
}
|
|
249
269
|
|
|
270
|
+
private fun updateTouchDelegate() {
|
|
271
|
+
post {
|
|
272
|
+
val hitRect = Rect()
|
|
273
|
+
getHitRect(hitRect)
|
|
274
|
+
|
|
275
|
+
mHitSlopRect?.let {
|
|
276
|
+
hitRect.left -= it.left
|
|
277
|
+
hitRect.top -= it.top
|
|
278
|
+
hitRect.right += it.right
|
|
279
|
+
hitRect.bottom += it.bottom
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
(parent as? ViewGroup)?.let {
|
|
283
|
+
it.touchDelegate = TouchDelegate(hitRect, this)
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
250
288
|
private fun getDrawableIdWithName(name: String): Int {
|
|
251
289
|
val appResources: Resources = context.resources
|
|
252
290
|
var resourceId = appResources.getIdentifier(name, "drawable", context.packageName)
|
package/android/src/main/java/com/reactnativemenu/{MenuViewManager.kt → MenuViewManagerBase.kt}
RENAMED
|
@@ -17,13 +17,9 @@ import com.facebook.react.views.view.ReactDrawableHelper
|
|
|
17
17
|
import com.facebook.react.views.view.ReactViewGroup
|
|
18
18
|
import com.facebook.yoga.YogaConstants
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
abstract class MenuViewManagerBase: ReactClippingViewManager<MenuView>() {
|
|
21
21
|
override fun getName() = "MenuView"
|
|
22
22
|
|
|
23
|
-
override fun createViewInstance(reactContext: ThemedReactContext): MenuView {
|
|
24
|
-
return MenuView(reactContext)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
23
|
@ReactProp(name = "actions")
|
|
28
24
|
fun setActions(view: MenuView, actions: ReadableArray) {
|
|
29
25
|
view.setActions(actions)
|
|
@@ -110,6 +106,7 @@ class MenuViewManager: ReactClippingViewManager<MenuView>() {
|
|
|
110
106
|
@ReactProp(name = "hitSlop")
|
|
111
107
|
fun setHitSlop(view: ReactViewGroup, @Nullable hitSlop: ReadableMap?) {
|
|
112
108
|
if (hitSlop == null) {
|
|
109
|
+
// We should keep using setters as `Val cannot be reassigned`
|
|
113
110
|
view.setHitSlopRect(null)
|
|
114
111
|
} else {
|
|
115
112
|
view.setHitSlopRect(Rect(
|
|
@@ -151,9 +148,7 @@ class MenuViewManager: ReactClippingViewManager<MenuView>() {
|
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
@ReactPropGroup(names = [ViewProps.BORDER_COLOR, ViewProps.BORDER_LEFT_COLOR, ViewProps.BORDER_RIGHT_COLOR, ViewProps.BORDER_TOP_COLOR, ViewProps.BORDER_BOTTOM_COLOR, ViewProps.BORDER_START_COLOR, ViewProps.BORDER_END_COLOR], customType = "Color")
|
|
154
|
-
fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?)
|
|
155
|
-
view.setBorderColor(index, color)
|
|
156
|
-
}
|
|
151
|
+
abstract fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?)
|
|
157
152
|
|
|
158
153
|
@ReactProp(name = ViewProps.OVERFLOW)
|
|
159
154
|
fun setOverflow(view: ReactViewGroup, overflow: String?) {
|
|
@@ -174,7 +169,18 @@ class MenuViewManager: ReactClippingViewManager<MenuView>() {
|
|
|
174
169
|
view.setBackfaceVisibilityDependantOpacity()
|
|
175
170
|
}
|
|
176
171
|
|
|
172
|
+
override fun getCommandsMap(): MutableMap<String, Int>? {
|
|
173
|
+
return MapBuilder.of("show", COMMAND_SHOW)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
override fun receiveCommand(root: MenuView, commandId: Int, args: ReadableArray?) {
|
|
177
|
+
when (commandId) {
|
|
178
|
+
COMMAND_SHOW -> root.show()
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
177
182
|
companion object {
|
|
183
|
+
val COMMAND_SHOW = 1
|
|
178
184
|
val SPACING_TYPES = arrayOf(
|
|
179
185
|
Spacing.ALL,
|
|
180
186
|
Spacing.LEFT,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.reactnativemenu
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
4
|
+
import com.facebook.yoga.YogaConstants
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
|
|
7
|
+
class MenuViewManager : MenuViewManagerBase() {
|
|
8
|
+
override fun createViewInstance(reactContext: ThemedReactContext): MenuView {
|
|
9
|
+
return MenuView(reactContext)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?) {
|
|
13
|
+
val rgbComponent = color?.let { (it and 0x00FFFFFF).toFloat() } ?: YogaConstants.UNDEFINED
|
|
14
|
+
val alphaComponent = color?.let { (it ushr 24).toFloat() } ?: YogaConstants.UNDEFINED
|
|
15
|
+
view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
package com.reactnativemenu
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
5
|
+
|
|
6
|
+
class MenuViewManager : MenuViewManagerBase() {
|
|
7
|
+
override fun createViewInstance(reactContext: ThemedReactContext): MenuView {
|
|
8
|
+
return MenuView(reactContext)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
override fun setBorderColor(view: ReactViewGroup, index: Int, color: Int?) {
|
|
12
|
+
view.setBorderColor(index, color)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -2,5 +2,8 @@ import Foundation
|
|
|
2
2
|
@objc public protocol FabricViewImplementationProtocol {
|
|
3
3
|
var actions: [NSDictionary]? { get set }
|
|
4
4
|
var title: NSString? { get set }
|
|
5
|
+
var themeVariant: NSString? { get set }
|
|
6
|
+
var shouldOpenOnLongPress: Bool { get set }
|
|
7
|
+
@objc optional var hitSlop: UIEdgeInsets { get set }
|
|
5
8
|
var onPressAction: ((String) -> Void)? { get set }
|
|
6
9
|
}
|
package/ios/NewArch/MenuView.mm
CHANGED
|
@@ -137,6 +137,26 @@ using namespace facebook::react;
|
|
|
137
137
|
_view.title = [NSString stringWithUTF8String:newViewProps.title.c_str()];
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
if (oldViewProps.themeVariant != newViewProps.themeVariant) {
|
|
141
|
+
_view.themeVariant = [NSString stringWithUTF8String:newViewProps.themeVariant.c_str()];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (oldViewProps.shouldOpenOnLongPress != newViewProps.shouldOpenOnLongPress) {
|
|
145
|
+
_view.shouldOpenOnLongPress = newViewProps.shouldOpenOnLongPress;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (oldViewProps.hitSlop.top != newViewProps.hitSlop.top ||
|
|
149
|
+
oldViewProps.hitSlop.bottom != newViewProps.hitSlop.bottom ||
|
|
150
|
+
oldViewProps.hitSlop.left != newViewProps.hitSlop.left ||
|
|
151
|
+
oldViewProps.hitSlop.right != newViewProps.hitSlop.right) {
|
|
152
|
+
_view.hitSlop = UIEdgeInsetsMake(
|
|
153
|
+
newViewProps.hitSlop.top,
|
|
154
|
+
newViewProps.hitSlop.left,
|
|
155
|
+
newViewProps.hitSlop.bottom,
|
|
156
|
+
newViewProps.hitSlop.right
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
140
160
|
[super updateProps:props oldProps:oldProps];
|
|
141
161
|
}
|
|
142
162
|
|
|
@@ -33,10 +33,10 @@ public class ActionSheetView: UIView {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
@objc var shouldOpenOnLongPress: Bool = false
|
|
36
|
+
@objc public var shouldOpenOnLongPress: Bool = false
|
|
37
37
|
|
|
38
38
|
private var _themeVariant: String?
|
|
39
|
-
@objc var themeVariant: NSString? {
|
|
39
|
+
@objc public var themeVariant: NSString? {
|
|
40
40
|
didSet { self._themeVariant = themeVariant as? String }
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -36,21 +36,21 @@ public class MenuViewImplementation: UIButton {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
@objc var shouldOpenOnLongPress: Bool = false {
|
|
39
|
+
@objc public var shouldOpenOnLongPress: Bool = false {
|
|
40
40
|
didSet {
|
|
41
41
|
self.setup()
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
private var _themeVariant: String?
|
|
46
|
-
@objc var themeVariant: NSString? {
|
|
46
|
+
@objc public var themeVariant: NSString? {
|
|
47
47
|
didSet {
|
|
48
48
|
self._themeVariant = themeVariant as? String
|
|
49
49
|
self.setup()
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
@objc var hitSlop: UIEdgeInsets = .zero
|
|
53
|
+
@objc public var hitSlop: UIEdgeInsets = .zero
|
|
54
54
|
|
|
55
55
|
override init(frame: CGRect) {
|
|
56
56
|
super.init(frame: frame)
|
|
@@ -14,5 +14,5 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
14
14
|
OR with extending types in an interface, so for now we'll just keep some duplicate
|
|
15
15
|
types here, to avoid issues while `pod install` takes place.
|
|
16
16
|
*/
|
|
17
|
-
var _default = exports.default = (0, _codegenNativeComponent.default)(
|
|
17
|
+
var _default = exports.default = (0, _codegenNativeComponent.default)("MenuView");
|
|
18
18
|
//# sourceMappingURL=UIMenuNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["NativeModuleSpecs/UIMenuNativeComponent.ts"],"mappings":";;;;;;AAKA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["NativeModuleSpecs/UIMenuNativeComponent.ts"],"mappings":";;;;;;AAKA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAsDe,IAAAG,+BAAsB,EACpC,UACD,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
const NativeMenuComponent = (0, _reactNative.requireNativeComponent)("MenuView");
|
|
11
|
+
const MenuComponent = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
12
|
+
const nativeRef = (0, _react.useRef)(null);
|
|
13
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
14
|
+
show: () => {
|
|
15
|
+
if (nativeRef.current) {
|
|
16
|
+
const node = (0, _reactNative.findNodeHandle)(nativeRef.current);
|
|
17
|
+
const command = _reactNative.UIManager.getViewManagerConfig("MenuView").Commands.show;
|
|
18
|
+
_reactNative.UIManager.dispatchViewManagerCommand(node, command, undefined);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}), []);
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(NativeMenuComponent, {
|
|
23
|
+
...props,
|
|
24
|
+
ref: nativeRef
|
|
25
|
+
});
|
|
26
|
+
});
|
|
9
27
|
var _default = exports.default = MenuComponent;
|
|
10
28
|
//# sourceMappingURL=UIMenuView.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_jsxRuntime","NativeMenuComponent","requireNativeComponent","MenuComponent","forwardRef","props","ref","nativeRef","useRef","useImperativeHandle","show","current","node","findNodeHandle","command","UIManager","getViewManagerConfig","Commands","dispatchViewManagerCommand","undefined","jsx","_default","exports","default"],"sourceRoot":"../../src","sources":["UIMenuView.android.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAAgE,IAAAE,WAAA,GAAAF,OAAA;AAEhE,MAAMG,mBAAmB,GAAG,IAAAC,mCAAsB,EACjD,UACD,CAA4C;AAE5C,MAAMC,aAAa,gBAAG,IAAAC,iBAAU,EAC/B,CAACC,KAAK,EAAEC,GAAG,KAAK;EACf,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAE9B,IAAAC,0BAAmB,EAClBH,GAAG,EACH,OAAO;IACNI,IAAI,EAAEA,CAAA,KAAM;MACX,IAAIH,SAAS,CAACI,OAAO,EAAE;QACtB,MAAMC,IAAI,GAAG,IAAAC,2BAAc,EAACN,SAAS,CAACI,OAAO,CAAC;QAC9C,MAAMG,OAAO,GACZC,sBAAS,CAACC,oBAAoB,CAAC,UAAU,CAAC,CAACC,QAAQ,CAACP,IAAI;QAEzDK,sBAAS,CAACG,0BAA0B,CAACN,IAAI,EAAEE,OAAO,EAAEK,SAAS,CAAC;MAC/D;IACD;EACD,CAAC,CAAC,EACF,EACD,CAAC;EAED,oBAAO,IAAAnB,WAAA,CAAAoB,GAAA,EAACnB,mBAAmB;IAAA,GAAKI,KAAK;IAAEC,GAAG,EAAEC;EAAU,CAAE,CAAC;AAC1D,CACD,CAAC;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEapB,aAAa","ignoreList":[]}
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
9
|
/**
|
|
13
10
|
* TODO: implement for Web
|
|
14
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_jsxRuntime","MenuView","style","children","testID","jsx","View","_default","exports","default"],"sourceRoot":"../../src","sources":["UIMenuView.tsx"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAoC,IAAAC,WAAA,GAAAD,OAAA;AAGpC;AACA;AACA;AACA,MAAME,QAAqE,GAAGA,CAAC;EAC9EC,KAAK;EACLC,QAAQ;EACRC;AACD,CAAC,KAAK;EACL,oBACC,IAAAJ,WAAA,CAAAK,GAAA,EAACP,YAAA,CAAAQ,IAAI;IAACJ,KAAK,EAAEA,KAAM;IAACE,MAAM,EAAEA,MAAO;IAAAD,QAAA,EACjCA;EAAQ,CACJ,CAAC;AAET,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaR,QAAQ","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MenuView = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _UIMenuView = _interopRequireDefault(require("./UIMenuView"));
|
|
10
10
|
var _utils = require("./utils");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
13
|
function processAction(action) {
|
|
16
14
|
return {
|
|
17
15
|
...action,
|
|
@@ -26,11 +24,11 @@ const defaultHitslop = {
|
|
|
26
24
|
bottom: 0,
|
|
27
25
|
right: 0
|
|
28
26
|
};
|
|
29
|
-
const MenuView = ({
|
|
27
|
+
const MenuView = exports.MenuView = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
30
28
|
actions,
|
|
31
29
|
hitSlop = defaultHitslop,
|
|
32
30
|
...props
|
|
33
|
-
}) => {
|
|
31
|
+
}, ref) => {
|
|
34
32
|
const processedActions = actions.map(action => processAction(action));
|
|
35
33
|
const hash = (0, _react.useMemo)(() => {
|
|
36
34
|
return (0, _utils.objectHash)(processedActions);
|
|
@@ -39,8 +37,8 @@ const MenuView = ({
|
|
|
39
37
|
...props,
|
|
40
38
|
hitSlop: hitSlop,
|
|
41
39
|
actions: processedActions,
|
|
42
|
-
actionsHash: hash
|
|
40
|
+
actionsHash: hash,
|
|
41
|
+
ref: ref
|
|
43
42
|
});
|
|
44
|
-
};
|
|
45
|
-
exports.MenuView = MenuView;
|
|
43
|
+
});
|
|
46
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_UIMenuView","_interopRequireDefault","_utils","_jsxRuntime","e","__esModule","default","processAction","action","imageColor","processColor","titleColor","subactions","map","subAction","defaultHitslop","top","left","bottom","right","MenuView","exports","forwardRef","actions","hitSlop","props","ref","processedActions","hash","useMemo","objectHash","jsx","actionsHash"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAQA,IAAAI,MAAA,GAAAJ,OAAA;AAAqC,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,SAASG,aAAaA,CAACC,MAAkB,EAAuB;EAC9D,OAAO;IACL,GAAGA,MAAM;IACTC,UAAU,EAAE,IAAAC,yBAAY,EAACF,MAAM,CAACC,UAAU,CAAC;IAC3CE,UAAU,EAAE,IAAAD,yBAAY,EAACF,MAAM,CAACG,UAAU,CAAC;IAC3CC,UAAU,EAAEJ,MAAM,CAACI,UAAU,EAAEC,GAAG,CAAEC,SAAS,IAAKP,aAAa,CAACO,SAAS,CAAC;EAC5E,CAAC;AACH;AAEA,MAAMC,cAAc,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAE/D,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,gBAAG,IAAAE,iBAAU,EACzB,CAAC;EAAEC,OAAO;EAAEC,OAAO,GAAGT,cAAc;EAAE,GAAGU;AAAM,CAAC,EAAEC,GAAG,KAAK;EACxD,MAAMC,gBAAgB,GAAGJ,OAAO,CAACV,GAAG,CAAuBL,MAAM,IAC/DD,aAAa,CAACC,MAAM,CACtB,CAAC;EACD,MAAMoB,IAAI,GAAG,IAAAC,cAAO,EAAC,MAAM;IACzB,OAAO,IAAAC,iBAAU,EAACH,gBAAgB,CAAC;EACrC,CAAC,EAAE,CAACA,gBAAgB,CAAC,CAAC;EAEtB,oBACE,IAAAxB,WAAA,CAAA4B,GAAA,EAAC/B,WAAA,CAAAM,OAAU;IAAA,GACLmB,KAAK;IACTD,OAAO,EAAEA,OAAQ;IACjBD,OAAO,EAAEI,gBAAiB;IAC1BK,WAAW,EAAEJ,IAAK;IAClBF,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
package/lib/commonjs/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["hashCode","str","hash","i","length","char","charCodeAt","objectHash","obj","jsonString","JSON","stringify","String"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAAA;AACA,SAASA,QAAQA,CAACC,GAAW,EAAU;
|
|
1
|
+
{"version":3,"names":["hashCode","str","hash","i","length","char","charCodeAt","objectHash","obj","jsonString","JSON","stringify","String"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAAA;AACA,SAASA,QAAQA,CAACC,GAAW,EAAU;EACtC,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACpC,MAAME,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAACH,CAAC,CAAC;IAC9B;IACAD,IAAI,GAAG,CAACA,IAAI,IAAI,CAAC,IAAIA,IAAI,GAAGG,IAAI;EACjC;EACA,OAAOH,IAAI;AACZ;;AAEA;AACO,SAASK,UAAUA,CAACC,GAA8B,EAAU;EAClE,IAAI,CAACA,GAAG,EAAE;IACT,OAAO,EAAE;EACV;EACA;EACA,MAAMC,UAAU,GAAGC,IAAI,CAACC,SAAS,CAACH,GAAG,CAAC;;EAEtC;EACA,MAAMN,IAAI,GAAGF,QAAQ,CAACS,UAAU,CAAC;;EAEjC;EACA,OAAOG,MAAM,CAACV,IAAI,CAAC;AACpB","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import codegenNativeComponent from
|
|
3
|
+
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
4
4
|
/*
|
|
5
5
|
Caution, those below are not just typescript types.
|
|
6
6
|
Codegen is using them to create the corresponding C++ data types.
|
|
@@ -10,5 +10,5 @@ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNati
|
|
|
10
10
|
types here, to avoid issues while `pod install` takes place.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
export default codegenNativeComponent(
|
|
13
|
+
export default codegenNativeComponent("MenuView");
|
|
14
14
|
//# sourceMappingURL=UIMenuNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["NativeModuleSpecs/UIMenuNativeComponent.ts"],"mappings":";;AAKA,OAAOA,sBAAsB,MAAM,yDAAyD;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["NativeModuleSpecs/UIMenuNativeComponent.ts"],"mappings":";;AAKA,OAAOA,sBAAsB,MAAM,yDAAyD;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+CA,eAAeA,sBAAsB,CACpC,UACD,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { requireNativeComponent } from
|
|
4
|
-
|
|
3
|
+
import { findNodeHandle, requireNativeComponent, UIManager } from "react-native";
|
|
4
|
+
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const NativeMenuComponent = requireNativeComponent("MenuView");
|
|
7
|
+
const MenuComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
+
const nativeRef = useRef(null);
|
|
9
|
+
useImperativeHandle(ref, () => ({
|
|
10
|
+
show: () => {
|
|
11
|
+
if (nativeRef.current) {
|
|
12
|
+
const node = findNodeHandle(nativeRef.current);
|
|
13
|
+
const command = UIManager.getViewManagerConfig("MenuView").Commands.show;
|
|
14
|
+
UIManager.dispatchViewManagerCommand(node, command, undefined);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}), []);
|
|
18
|
+
return /*#__PURE__*/_jsx(NativeMenuComponent, {
|
|
19
|
+
...props,
|
|
20
|
+
ref: nativeRef
|
|
21
|
+
});
|
|
22
|
+
});
|
|
5
23
|
export default MenuComponent;
|
|
6
24
|
//# sourceMappingURL=UIMenuView.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requireNativeComponent","MenuComponent"],"sourceRoot":"../../src","sources":["UIMenuView.android.tsx"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"names":["findNodeHandle","requireNativeComponent","UIManager","forwardRef","useImperativeHandle","useRef","jsx","_jsx","NativeMenuComponent","MenuComponent","props","ref","nativeRef","show","current","node","command","getViewManagerConfig","Commands","dispatchViewManagerCommand","undefined"],"sourceRoot":"../../src","sources":["UIMenuView.android.tsx"],"mappings":";;AAAA,SACCA,cAAc,EAEdC,sBAAsB,EACtBC,SAAS,QACH,cAAc;AAErB,SAASC,UAAU,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhE,MAAMC,mBAAmB,GAAGP,sBAAsB,CACjD,UACD,CAA4C;AAE5C,MAAMQ,aAAa,gBAAGN,UAAU,CAC/B,CAACO,KAAK,EAAEC,GAAG,KAAK;EACf,MAAMC,SAAS,GAAGP,MAAM,CAAC,IAAI,CAAC;EAE9BD,mBAAmB,CAClBO,GAAG,EACH,OAAO;IACNE,IAAI,EAAEA,CAAA,KAAM;MACX,IAAID,SAAS,CAACE,OAAO,EAAE;QACtB,MAAMC,IAAI,GAAGf,cAAc,CAACY,SAAS,CAACE,OAAO,CAAC;QAC9C,MAAME,OAAO,GACZd,SAAS,CAACe,oBAAoB,CAAC,UAAU,CAAC,CAACC,QAAQ,CAACL,IAAI;QAEzDX,SAAS,CAACiB,0BAA0B,CAACJ,IAAI,EAAEC,OAAO,EAAEI,SAAS,CAAC;MAC/D;IACD;EACD,CAAC,CAAC,EACF,EACD,CAAC;EAED,oBAAOb,IAAA,CAACC,mBAAmB;IAAA,GAAKE,KAAK;IAAEC,GAAG,EAAEC;EAAU,CAAE,CAAC;AAC1D,CACD,CAAC;AAED,eAAeH,aAAa","ignoreList":[]}
|
package/lib/module/UIMenuView.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["View","jsx","_jsx","MenuView","style","children","testID"],"sourceRoot":"../../src","sources":["UIMenuView.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGpC;AACA;AACA;AACA,MAAMC,QAAqE,GAAGA,CAAC;EAC9EC,KAAK;EACLC,QAAQ;EACRC;AACD,CAAC,KAAK;EACL,oBACCJ,IAAA,CAACF,IAAI;IAACI,KAAK,EAAEA,KAAM;IAACE,MAAM,EAAEA,MAAO;IAAAD,QAAA,EACjCA;EAAQ,CACJ,CAAC;AAET,CAAC;AAED,eAAeF,QAAQ","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { processColor } from
|
|
5
|
-
import UIMenuView from
|
|
6
|
-
import { objectHash } from
|
|
3
|
+
import { forwardRef, useMemo } from "react";
|
|
4
|
+
import { processColor } from "react-native";
|
|
5
|
+
import UIMenuView from "./UIMenuView";
|
|
6
|
+
import { objectHash } from "./utils";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
function processAction(action) {
|
|
9
9
|
return {
|
|
@@ -19,11 +19,11 @@ const defaultHitslop = {
|
|
|
19
19
|
bottom: 0,
|
|
20
20
|
right: 0
|
|
21
21
|
};
|
|
22
|
-
const MenuView = ({
|
|
22
|
+
const MenuView = /*#__PURE__*/forwardRef(({
|
|
23
23
|
actions,
|
|
24
24
|
hitSlop = defaultHitslop,
|
|
25
25
|
...props
|
|
26
|
-
}) => {
|
|
26
|
+
}, ref) => {
|
|
27
27
|
const processedActions = actions.map(action => processAction(action));
|
|
28
28
|
const hash = useMemo(() => {
|
|
29
29
|
return objectHash(processedActions);
|
|
@@ -32,8 +32,9 @@ const MenuView = ({
|
|
|
32
32
|
...props,
|
|
33
33
|
hitSlop: hitSlop,
|
|
34
34
|
actions: processedActions,
|
|
35
|
-
actionsHash: hash
|
|
35
|
+
actionsHash: hash,
|
|
36
|
+
ref: ref
|
|
36
37
|
});
|
|
37
|
-
};
|
|
38
|
+
});
|
|
38
39
|
export { MenuView };
|
|
39
40
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["forwardRef","useMemo","processColor","UIMenuView","objectHash","jsx","_jsx","processAction","action","imageColor","titleColor","subactions","map","subAction","defaultHitslop","top","left","bottom","right","MenuView","actions","hitSlop","props","ref","processedActions","hash","actionsHash"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,YAAY,QAAQ,cAAc;AAE3C,OAAOC,UAAU,MAAM,cAAc;AAQrC,SAASC,UAAU,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,SAASC,aAAaA,CAACC,MAAkB,EAAuB;EAC9D,OAAO;IACL,GAAGA,MAAM;IACTC,UAAU,EAAEP,YAAY,CAACM,MAAM,CAACC,UAAU,CAAC;IAC3CC,UAAU,EAAER,YAAY,CAACM,MAAM,CAACE,UAAU,CAAC;IAC3CC,UAAU,EAAEH,MAAM,CAACG,UAAU,EAAEC,GAAG,CAAEC,SAAS,IAAKN,aAAa,CAACM,SAAS,CAAC;EAC5E,CAAC;AACH;AAEA,MAAMC,cAAc,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAE/D,MAAMC,QAAQ,gBAAGnB,UAAU,CACzB,CAAC;EAAEoB,OAAO;EAAEC,OAAO,GAAGP,cAAc;EAAE,GAAGQ;AAAM,CAAC,EAAEC,GAAG,KAAK;EACxD,MAAMC,gBAAgB,GAAGJ,OAAO,CAACR,GAAG,CAAuBJ,MAAM,IAC/DD,aAAa,CAACC,MAAM,CACtB,CAAC;EACD,MAAMiB,IAAI,GAAGxB,OAAO,CAAC,MAAM;IACzB,OAAOG,UAAU,CAACoB,gBAAgB,CAAC;EACrC,CAAC,EAAE,CAACA,gBAAgB,CAAC,CAAC;EAEtB,oBACElB,IAAA,CAACH,UAAU;IAAA,GACLmB,KAAK;IACTD,OAAO,EAAEA,OAAQ;IACjBD,OAAO,EAAEI,gBAAiB;IAC1BE,WAAW,EAAED,IAAK;IAClBF,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CACF,CAAC;AAED,SAASJ,QAAQ","ignoreList":[]}
|
package/lib/module/utils.js
CHANGED