@react-native-menu/menu 0.4.1 → 0.5.2
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/.editorconfig +15 -0
- package/.gitattributes +3 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- package/.github/dependabot.yml +51 -0
- package/.github/workflows/ci.yml +90 -0
- package/.gitignore +60 -0
- package/CONTRIBUTING.md +184 -0
- package/README.md +11 -2
- package/android/gradle.properties +3 -3
- package/android/src/main/java/com/reactnativemenu/MenuView.kt +83 -54
- package/android/src/main/java/com/reactnativemenu/MenuViewManager.kt +5 -0
- package/babel.config.js +3 -0
- package/example/.gitignore +14 -0
- package/{android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json → example/.watchmanconfig} +0 -0
- package/example/android/build.gradle +14 -0
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/example/android/gradle.properties +6 -0
- package/example/android/gradlew +185 -0
- package/example/android/gradlew.bat +89 -0
- package/example/android/settings.gradle +12 -0
- package/example/app.json +28 -0
- package/example/babel.config.js +3 -0
- package/example/index.tsx +5 -0
- package/example/ios/Podfile +7 -0
- package/example/ios/Podfile.lock +515 -0
- package/example/metro.config.js +44 -0
- package/example/package.json +34 -0
- package/example/react-native.config.js +61 -0
- package/example/src/App.tsx +187 -0
- package/example/yarn.lock +6542 -0
- package/ios/ActionSheetView.swift +26 -12
- package/ios/MenuView.swift +8 -2
- package/ios/RCTUIMenuManager.m +4 -0
- package/lib/commonjs/UIMenuView.js +2 -2
- package/lib/commonjs/types.js +4 -0
- package/lib/module/types.js +1 -1
- package/lib/typescript/example/index.d.ts +1 -0
- package/lib/typescript/example/src/App.d.ts +2 -0
- package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
- package/lib/typescript/src/types.d.ts +6 -0
- package/package.json +8 -7
- package/src/__tests__/index.test.tsx +1 -0
- package/src/types.ts +6 -0
- package/tsconfig.json +27 -0
- package/yarn.lock +9701 -0
- package/android/build/.transforms/fc5f9acad800c84b4b9e229c2b286008/classes/classes.dex +0 -0
- package/android/build/.transforms/fc5f9acad800c84b4b9e229c2b286008.bin +0 -1
- package/android/build/generated/source/buildConfig/debug/com/reactnativemenu/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -16
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1789
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/reactnativemenu/BuildConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -13
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -16
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1315
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
- package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +0 -2
- package/android/build/tmp/kotlin-classes/debug/META-INF/reactnativemenu_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuView$prepareMenu$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuView$prepareMenu$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuViewManager$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativemenu/MenuViewManager.class +0 -0
|
@@ -11,14 +11,9 @@ import UIKit
|
|
|
11
11
|
@objc(ActionSheetView)
|
|
12
12
|
class ActionSheetView: UIView {
|
|
13
13
|
@objc var onPressAction: RCTDirectEventBlock?
|
|
14
|
-
private var _title: String
|
|
14
|
+
private var _title: String?;
|
|
15
15
|
@objc var title: NSString? {
|
|
16
|
-
didSet {
|
|
17
|
-
guard let title = self.title else {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
self._title = title as String
|
|
21
|
-
}
|
|
16
|
+
didSet { self._title = title as? String }
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
private var _actions: [UIAlertAction] = [];
|
|
@@ -27,6 +22,7 @@ class ActionSheetView: UIView {
|
|
|
27
22
|
guard let actions = self.actions else {
|
|
28
23
|
return
|
|
29
24
|
}
|
|
25
|
+
_actions.removeAll()
|
|
30
26
|
actions.forEach({ alertAction in
|
|
31
27
|
if let action = RCTAlertAction(details: alertAction).createAction({
|
|
32
28
|
event in self.sendButtonAction(event)
|
|
@@ -37,11 +33,14 @@ class ActionSheetView: UIView {
|
|
|
37
33
|
}
|
|
38
34
|
}
|
|
39
35
|
|
|
36
|
+
@objc var shouldOpenOnLongPress: Bool = false
|
|
40
37
|
|
|
41
38
|
override init(frame: CGRect) {
|
|
42
39
|
super.init(frame: frame)
|
|
43
40
|
let tap = UITapGestureRecognizer(target: self, action: #selector (self.handleTap (_:)))
|
|
41
|
+
let longPress = UILongPressGestureRecognizer(target: self, action: #selector(self.handleLongPress(_:)))
|
|
44
42
|
self.addGestureRecognizer(tap)
|
|
43
|
+
self.addGestureRecognizer(longPress)
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
func launchActionSheet() {
|
|
@@ -49,7 +48,7 @@ class ActionSheetView: UIView {
|
|
|
49
48
|
let alert = UIAlertController(title: _title, message: nil, preferredStyle: .actionSheet)
|
|
50
49
|
|
|
51
50
|
self._actions.forEach({action in
|
|
52
|
-
alert.addAction(action)
|
|
51
|
+
alert.addAction(action.copy() as! UIAlertAction)
|
|
53
52
|
})
|
|
54
53
|
|
|
55
54
|
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
|
|
@@ -67,10 +66,25 @@ class ActionSheetView: UIView {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
|
|
70
|
-
@objc func handleTap(_ sender:UITapGestureRecognizer){
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
@objc func handleTap(_ sender:UITapGestureRecognizer) {
|
|
70
|
+
if shouldOpenOnLongPress {
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
if sender.state == .ended {
|
|
74
|
+
DispatchQueue.main.async {
|
|
75
|
+
self.launchActionSheet()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@objc func handleLongPress(_ sender: UILongPressGestureRecognizer) {
|
|
81
|
+
if !shouldOpenOnLongPress {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
if sender.state == .ended {
|
|
85
|
+
DispatchQueue.main.async {
|
|
86
|
+
self.launchActionSheet()
|
|
87
|
+
}
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
90
|
|
package/ios/MenuView.swift
CHANGED
|
@@ -16,6 +16,7 @@ class MenuView: UIButton {
|
|
|
16
16
|
guard let actions = self.actions else {
|
|
17
17
|
return
|
|
18
18
|
}
|
|
19
|
+
_actions.removeAll()
|
|
19
20
|
actions.forEach { menuAction in
|
|
20
21
|
_actions.append(RCTMenuAction(details: menuAction).createUIMenuElement({action in self.sendButtonAction(action)}))
|
|
21
22
|
}
|
|
@@ -34,7 +35,12 @@ class MenuView: UIButton {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
@objc var onPressAction: RCTDirectEventBlock?
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
@objc var shouldOpenOnLongPress: Bool = false {
|
|
40
|
+
didSet {
|
|
41
|
+
self.setup()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
|
|
39
45
|
override init(frame: CGRect) {
|
|
40
46
|
super.init(frame: frame)
|
|
@@ -46,7 +52,7 @@ class MenuView: UIButton {
|
|
|
46
52
|
let menu = UIMenu(title:_title, identifier: nil, options: .displayInline, children: self._actions)
|
|
47
53
|
|
|
48
54
|
self.menu = menu
|
|
49
|
-
self.showsMenuAsPrimaryAction =
|
|
55
|
+
self.showsMenuAsPrimaryAction = !shouldOpenOnLongPress
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
override func reactSetFrame(_ frame: CGRect) {
|
package/ios/RCTUIMenuManager.m
CHANGED
|
@@ -15,5 +15,9 @@ RCT_EXPORT_VIEW_PROPERTY(actions, NSArray);
|
|
|
15
15
|
* onPressAction: callback to be called once user selects an action
|
|
16
16
|
*/
|
|
17
17
|
RCT_EXPORT_VIEW_PROPERTY(onPressAction, RCTDirectEventBlock);
|
|
18
|
+
/**
|
|
19
|
+
* shouldOpenOnLongPress: determines whether menu should be opened after long press or normal press
|
|
20
|
+
*/
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(shouldOpenOnLongPress, BOOL)
|
|
18
22
|
|
|
19
23
|
@end
|
|
@@ -9,9 +9,9 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
|
|
14
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* TODO: implement for Web
|
package/lib/commonjs/types.js
CHANGED
package/lib/module/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -103,6 +103,12 @@ export declare type MenuComponentProps = {
|
|
|
103
103
|
* @platform Android
|
|
104
104
|
*/
|
|
105
105
|
isAnchoredToRight?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Determines if menu should open after long press or on normal press
|
|
108
|
+
*
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
shouldOpenOnLongPress?: boolean;
|
|
106
112
|
};
|
|
107
113
|
export declare type ProcessedMenuAction = Omit<MenuAction, 'imageColor' | 'titleColor' | 'subactions'> & {
|
|
108
114
|
imageColor: ReturnType<typeof processColor>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-menu/menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "UIMenu component for react-native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -43,20 +43,21 @@
|
|
|
43
43
|
"homepage": "https://github.com/react-native-menu/menu#readme",
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@react-native-community/bob": "^0.17.1",
|
|
46
|
-
"@react-native-community/eslint-config": "^
|
|
46
|
+
"@react-native-community/eslint-config": "^3.0.0",
|
|
47
47
|
"@release-it/conventional-changelog": "^1.1.4",
|
|
48
48
|
"@types/jest": "^26.0.0",
|
|
49
49
|
"@types/react": "^17.0.1",
|
|
50
|
-
"@types/react-native": "0.
|
|
51
|
-
"eslint": "7.
|
|
50
|
+
"@types/react-native": "0.66.2",
|
|
51
|
+
"eslint": "7.32.0",
|
|
52
52
|
"eslint-config-prettier": "^8.1.0",
|
|
53
53
|
"eslint-plugin-prettier": "^3.1.3",
|
|
54
|
-
"jest": "^
|
|
54
|
+
"jest": "^27.0.6",
|
|
55
55
|
"pod-install": "^0.1.0",
|
|
56
56
|
"prettier": "^2.2.1",
|
|
57
57
|
"react": "17.0.1",
|
|
58
|
-
"react-native": "0.64.
|
|
59
|
-
"
|
|
58
|
+
"react-native": "0.64.1",
|
|
59
|
+
"react-native-test-app": "^0.7.5",
|
|
60
|
+
"release-it": "^14.10.0",
|
|
60
61
|
"typescript": "^4.1.3"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
it.todo('write a test');
|
package/src/types.ts
CHANGED
|
@@ -113,6 +113,12 @@ export type MenuComponentProps = {
|
|
|
113
113
|
* @platform Android
|
|
114
114
|
*/
|
|
115
115
|
isAnchoredToRight?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Determines if menu should open after long press or on normal press
|
|
118
|
+
*
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
shouldOpenOnLongPress?: boolean;
|
|
116
122
|
};
|
|
117
123
|
|
|
118
124
|
export type ProcessedMenuAction = Omit<
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"@react-native-menu/menu": ["./src/index"]
|
|
6
|
+
},
|
|
7
|
+
"allowUnreachableCode": false,
|
|
8
|
+
"allowUnusedLabels": false,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"importsNotUsedAsValues": "error",
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"lib": ["esnext"],
|
|
14
|
+
"module": "esnext",
|
|
15
|
+
"moduleResolution": "node",
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"noImplicitUseStrict": false,
|
|
19
|
+
"noStrictGenericChecks": false,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"resolveJsonModule": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"strict": true,
|
|
25
|
+
"target": "esnext"
|
|
26
|
+
}
|
|
27
|
+
}
|