@react-native-menu/menu 0.5.3 → 0.7.0

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.
Files changed (42) hide show
  1. package/android/gradle.properties +3 -3
  2. package/ios/MenuView.swift +9 -9
  3. package/ios/RCTMenuItem.swift +24 -13
  4. package/lib/commonjs/types.js.map +1 -1
  5. package/lib/module/types.js.map +1 -1
  6. package/lib/typescript/src/types.d.ts +4 -0
  7. package/package.json +7 -7
  8. package/src/types.ts +4 -0
  9. package/.editorconfig +0 -15
  10. package/.gitattributes +0 -3
  11. package/.github/CODEOWNERS +0 -1
  12. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  13. package/.github/dependabot.yml +0 -51
  14. package/.github/workflows/ci.yml +0 -90
  15. package/.gitignore +0 -60
  16. package/CONTRIBUTING.md +0 -184
  17. package/babel.config.js +0 -3
  18. package/example/.gitignore +0 -14
  19. package/example/.watchmanconfig +0 -1
  20. package/example/android/build.gradle +0 -14
  21. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  22. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  23. package/example/android/gradle.properties +0 -6
  24. package/example/android/gradlew +0 -185
  25. package/example/android/gradlew.bat +0 -89
  26. package/example/android/settings.gradle +0 -12
  27. package/example/app.json +0 -28
  28. package/example/babel.config.js +0 -3
  29. package/example/index.tsx +0 -5
  30. package/example/ios/Podfile +0 -7
  31. package/example/ios/Podfile.lock +0 -515
  32. package/example/metro.config.js +0 -44
  33. package/example/package.json +0 -34
  34. package/example/react-native.config.js +0 -61
  35. package/example/src/App.tsx +0 -187
  36. package/example/yarn.lock +0 -6542
  37. package/lib/typescript/example/index.d.ts +0 -1
  38. package/lib/typescript/example/src/App.d.ts +0 -2
  39. package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
  40. package/src/__tests__/index.test.tsx +0 -1
  41. package/tsconfig.json +0 -27
  42. package/yarn.lock +0 -10334
@@ -1,4 +1,4 @@
1
- Menu_kotlinVersion=1.3.50
2
- Menu_compileSdkVersion=29
1
+ Menu_kotlinVersion=1.6.10
2
+ Menu_compileSdkVersion=30
3
3
  Menu_buildToolsVersion=30.0.3
4
- Menu_targetSdkVersion=29
4
+ Menu_targetSdkVersion=30
@@ -23,7 +23,7 @@ class MenuView: UIButton {
23
23
  self.setup()
24
24
  }
25
25
  }
26
-
26
+
27
27
  private var _title: String = "";
28
28
  @objc var title: NSString? {
29
29
  didSet {
@@ -35,35 +35,35 @@ class MenuView: UIButton {
35
35
  }
36
36
  }
37
37
  @objc var onPressAction: RCTDirectEventBlock?
38
-
38
+
39
39
  @objc var shouldOpenOnLongPress: Bool = false {
40
40
  didSet {
41
41
  self.setup()
42
42
  }
43
43
  }
44
-
44
+
45
45
  override init(frame: CGRect) {
46
46
  super.init(frame: frame)
47
47
  self.setup()
48
48
  }
49
49
 
50
-
50
+
51
51
  func setup () {
52
- let menu = UIMenu(title:_title, identifier: nil, options: .displayInline, children: self._actions)
52
+ let menu = UIMenu(title:_title, identifier: nil, children: self._actions)
53
53
 
54
54
  self.menu = menu
55
55
  self.showsMenuAsPrimaryAction = !shouldOpenOnLongPress
56
56
  }
57
-
57
+
58
58
  override func reactSetFrame(_ frame: CGRect) {
59
59
  super.reactSetFrame(frame);
60
60
  };
61
-
62
-
61
+
62
+
63
63
  required init?(coder aDecoder: NSCoder) {
64
64
  fatalError("init(coder:) has not been implemented")
65
65
  }
66
-
66
+
67
67
  @objc func sendButtonAction(_ action: UIAction) {
68
68
  if let onPress = onPressAction {
69
69
  onPress(["event":action.identifier.rawValue])
@@ -9,38 +9,45 @@ import UIKit;
9
9
 
10
10
  @available(iOS 13.0, *)
11
11
  class RCTMenuAction {
12
-
12
+
13
13
  var identifier: UIAction.Identifier?;
14
14
  var title: String;
15
15
  var subtitle: String?
16
+ var displayInline: Bool
16
17
  var image: UIImage?
17
18
  var attributes: UIAction.Attributes = []
18
19
  var state: UIAction.State = .off
19
20
  var subactions: [RCTMenuAction] = []
20
-
21
+
21
22
  init(details: NSDictionary){
22
-
23
+
23
24
  if let identifier = details["id"] as? NSString {
24
25
  self.identifier = UIAction.Identifier(rawValue: identifier as String);
25
26
  }
26
-
27
+
27
28
  if let image = details["image"] as? NSString {
28
29
  self.image = UIImage(systemName: image as String);
29
30
  if let imageColor = details["imageColor"] {
30
31
  self.image = self.image?.withTintColor(RCTConvert.uiColor(imageColor), renderingMode: .alwaysOriginal)
31
32
  }
32
33
  }
33
-
34
+
34
35
  if let title = details["title"] as? NSString {
35
36
  self.title = title as String;
36
37
  } else {
37
38
  self.title = "";
38
39
  }
39
-
40
+
40
41
  if let subtitle = details["subtitle"] as? NSString {
41
42
  self.subtitle = subtitle as String;
42
43
  }
43
-
44
+
45
+ if let displayInline = details["displayInline"] as? Bool {
46
+ self.displayInline = displayInline as Bool;
47
+ } else {
48
+ self.displayInline = false;
49
+ }
50
+
44
51
  if let attributes = details["attributes"] as? NSDictionary {
45
52
  if (attributes["destructive"] as? Bool) == true {
46
53
  self.attributes.update(with: .destructive)
@@ -52,7 +59,7 @@ class RCTMenuAction {
52
59
  self.attributes.update(with: .hidden)
53
60
  }
54
61
  }
55
-
62
+
56
63
  if let state = details["state"] as? NSString {
57
64
  if state=="on" {
58
65
  self.state = .on
@@ -64,7 +71,7 @@ class RCTMenuAction {
64
71
  self.state = .mixed
65
72
  }
66
73
  }
67
-
74
+
68
75
  if let subactions = details["subactions"] as? NSArray {
69
76
  if subactions.count > 0 {
70
77
  for subaction in subactions {
@@ -72,17 +79,21 @@ class RCTMenuAction {
72
79
  }
73
80
  }
74
81
  }
75
-
76
-
82
+
83
+
77
84
  }
78
-
85
+
79
86
  func createUIMenuElement(_ handler: @escaping UIActionHandler) -> UIMenuElement {
80
87
  if subactions.count > 0 {
81
88
  var subMenuActions: [UIMenuElement] = []
82
89
  subactions.forEach { subaction in
83
90
  subMenuActions.append(subaction.createUIMenuElement(handler))
84
91
  }
85
- return UIMenu(title: title, image: image, identifier: nil, children: subMenuActions)
92
+ if self.displayInline {
93
+ return UIMenu(title: title, image: image, options: .displayInline, children: subMenuActions)
94
+ } else {
95
+ return UIMenu(title: title, image: image, children: subMenuActions)
96
+ }
86
97
  }
87
98
  return UIAction(title: title, image: image, identifier: identifier, discoverabilityTitle: subtitle, attributes: attributes, state: state, handler: handler)
88
99
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n ColorValue,\n processColor,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport type * as React from 'react';\n\nexport type NativeActionEvent = {\n nativeEvent: {\n event: string;\n };\n};\n\ntype MenuAttributes = {\n /**\n * An attribute indicating the destructive style.\n */\n destructive?: boolean;\n /**\n * An attribute indicating the disabled style.\n */\n disabled?: boolean;\n /**\n * An attribute indicating the hidden style.\n */\n hidden?: boolean;\n};\n\n/**\n * The state of the action.\n * - off: A constant indicating the menu element is in the “off” state.\n * - on: A constant indicating the menu element is in the “on” state.\n * - mixed: A constant indicating the menu element is in the “mixed” state.\n */\ntype MenuState = 'off' | 'on' | 'mixed';\n\nexport type MenuAction = {\n /**\n * Identifier of the menu action.\n * The value set in this id will be returned when menu is selected.\n */\n id?: string;\n /**\n * The action's title.\n */\n title: string;\n /**\n * (Android only)\n * The action's title color.\n * @platform Android\n */\n titleColor?: number | ColorValue;\n /**\n * (iOS14+ only)\n * An elaborated title that explains the purpose of the action.\n * @platform iOS\n */\n subtitle?: string;\n /**\n * The attributes indicating the style of the action.\n */\n attributes?: MenuAttributes;\n /**\n * (iOS14+ only)\n * The state of the action.\n * @platform iOS\n */\n state?: MenuState;\n /**\n * (Android and iOS13+ only)\n * - The action's image.\n * - Allows icon name included in project or system (Android) resources drawables and\n * in SF Symbol (iOS)\n * @example // (iOS)\n * image=\"plus\"\n * @example // (Android)\n * image=\"ic_menu_add\"\n * - TODO: Allow images other than those included in SF Symbol and resources drawables\n */\n image?: string;\n /**\n * (Android and iOS13+ only)\n * - The action's image color.\n */\n imageColor?: number | ColorValue;\n /**\n * (Android and iOS14+ only)\n * - Actions to be displayed in the sub menu\n * - On Android it does not support nesting next sub menus in sub menu item\n */\n subactions?: MenuAction[];\n /**\n * Whether subactions should be inline (separated by divider) or nested (sub menu)\n */\n displayInline?: boolean;\n};\n\ntype MenuComponentPropsBase = {\n style?: StyleProp<ViewStyle>;\n /**\n * Callback function that will be called when selecting a menu item.\n * It will contain id of the given action.\n */\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n /**\n * Actions to be displayed in the menu.\n */\n actions: MenuAction[];\n /**\n * The title of the menu.\n */\n title?: string;\n /**\n * (Android API 23+)\n * Boolean value determines whether popup menu should be anchored\n * to right corner of parent view - default value is `false`\n * @platform Android\n */\n isAnchoredToRight?: boolean;\n /**\n * Determines if menu should open after long press or on normal press\n *\n * @default false\n */\n shouldOpenOnLongPress?: boolean;\n};\n\nexport type MenuComponentProps =\n React.PropsWithChildren<MenuComponentPropsBase>;\n\nexport type ProcessedMenuAction = Omit<\n MenuAction,\n 'imageColor' | 'titleColor' | 'subactions'\n> & {\n imageColor: ReturnType<typeof processColor>;\n titleColor: ReturnType<typeof processColor>;\n subactions?: ProcessedMenuAction[];\n};\n\nexport type NativeMenuComponentProps = {\n style?: StyleProp<ViewStyle>;\n onPressAction?: ({ nativeEvent }: NativeActionEvent) => void;\n actions: ProcessedMenuAction[];\n title?: string;\n};\n"],"mappings":""}
@@ -81,6 +81,10 @@ export declare type MenuAction = {
81
81
  * - On Android it does not support nesting next sub menus in sub menu item
82
82
  */
83
83
  subactions?: MenuAction[];
84
+ /**
85
+ * Whether subactions should be inline (separated by divider) or nested (sub menu)
86
+ */
87
+ displayInline?: boolean;
84
88
  };
85
89
  declare type MenuComponentPropsBase = {
86
90
  style?: StyleProp<ViewStyle>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-menu/menu",
3
- "version": "0.5.3",
3
+ "version": "0.7.0",
4
4
  "description": "UIMenu component for react-native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -44,19 +44,19 @@
44
44
  "devDependencies": {
45
45
  "@react-native-community/bob": "^0.17.1",
46
46
  "@react-native-community/eslint-config": "^3.0.0",
47
- "@release-it/conventional-changelog": "^1.1.4",
48
- "@types/jest": "^27.0.3",
47
+ "@release-it/conventional-changelog": "^3.0.1",
48
+ "@types/jest": "^29.1.2",
49
49
  "@types/react": "^17.0.1",
50
50
  "@types/react-native": "0.67.6",
51
- "eslint": "7.32.0",
51
+ "eslint": "8.26.0",
52
52
  "eslint-config-prettier": "^8.1.0",
53
- "eslint-plugin-prettier": "^3.1.3",
54
- "jest": "^27.0.6",
53
+ "eslint-plugin-prettier": "^4.2.1",
54
+ "jest": "^29.1.2",
55
55
  "pod-install": "^0.1.0",
56
56
  "prettier": "^2.2.1",
57
57
  "react": "17.0.1",
58
58
  "react-native": "0.64.1",
59
- "react-native-test-app": "^1.6.17",
59
+ "react-native-test-app": "^2.0.0",
60
60
  "release-it": "^14.10.0",
61
61
  "typescript": "^4.1.3"
62
62
  },
package/src/types.ts CHANGED
@@ -90,6 +90,10 @@ export type MenuAction = {
90
90
  * - On Android it does not support nesting next sub menus in sub menu item
91
91
  */
92
92
  subactions?: MenuAction[];
93
+ /**
94
+ * Whether subactions should be inline (separated by divider) or nested (sub menu)
95
+ */
96
+ displayInline?: boolean;
93
97
  };
94
98
 
95
99
  type MenuComponentPropsBase = {
package/.editorconfig DELETED
@@ -1,15 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
- [*]
8
-
9
- indent_style = space
10
- indent_size = 2
11
-
12
- end_of_line = lf
13
- charset = utf-8
14
- trim_trailing_whitespace = true
15
- insert_final_newline = true
package/.gitattributes DELETED
@@ -1,3 +0,0 @@
1
- *.pbxproj -text
2
- # specific for windows script files
3
- *.bat text eol=crlf
@@ -1 +0,0 @@
1
- * @Naturalclar
@@ -1,8 +0,0 @@
1
- # Overview
2
-
3
- <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. -->
4
- <!-- Help us understand your motivation by explaining why you decided to make this change -->
5
-
6
- # Test Plan
7
-
8
- <!-- Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos! Increase test coverage whenever possible. -->
@@ -1,51 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- open-pull-requests-limit: 10
8
- ignore:
9
- - dependency-name: pod-install
10
- versions:
11
- - 0.1.16
12
- - 0.1.17
13
- - 0.1.19
14
- - 0.1.20
15
- - dependency-name: release-it
16
- versions:
17
- - 14.2.2
18
- - 14.3.0
19
- - 14.4.0
20
- - 14.4.1
21
- - 14.5.0
22
- - 14.5.1
23
- - dependency-name: eslint
24
- versions:
25
- - 7.18.0
26
- - 7.20.0
27
- - 7.23.0
28
- - dependency-name: "@types/react-native"
29
- versions:
30
- - 0.63.49
31
- - 0.63.51
32
- - 0.64.0
33
- - dependency-name: react-native
34
- versions:
35
- - 0.64.0
36
- - dependency-name: react
37
- versions:
38
- - 17.0.1
39
- - dependency-name: typescript
40
- versions:
41
- - 4.1.4
42
- - 4.2.3
43
- - dependency-name: eslint-config-prettier
44
- versions:
45
- - 8.0.0
46
- - dependency-name: prettier
47
- versions:
48
- - 2.2.1
49
- - dependency-name: "@types/react"
50
- versions:
51
- - 17.0.0
@@ -1,90 +0,0 @@
1
- name: Build
2
- on: push
3
-
4
- jobs:
5
- lint:
6
- runs-on: ubuntu-18.04
7
- strategy:
8
- matrix:
9
- node-version: [12]
10
- steps:
11
- - uses: actions/checkout@v2
12
- - uses: actions/setup-node@v1
13
- with:
14
- node-version: ${{ matrix.node-version }}
15
- - name: Get yarn cache
16
- id: yarn-cache
17
- run: echo "::set-output name=dir::$(yarn cache dir)"
18
- - uses: actions/cache@v2
19
- with:
20
- path: ${{ steps.yarn-cache.outputs.dir }}
21
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22
- - name: Install Dependencies
23
- run: yarn
24
- - name: ESLint Checks
25
- run: yarn lint
26
- tsc:
27
- runs-on: ubuntu-18.04
28
- strategy:
29
- matrix:
30
- node-version: [12]
31
- steps:
32
- - uses: actions/checkout@v2
33
- - uses: actions/setup-node@v1
34
- with:
35
- node-version: ${{ matrix.node-version }}
36
- - name: Get yarn cache
37
- id: yarn-cache
38
- run: echo "::set-output name=dir::$(yarn cache dir)"
39
- - uses: actions/cache@v2
40
- with:
41
- path: ${{ steps.yarn-cache.outputs.dir }}
42
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
43
- - name: Install Dependencies
44
- run: yarn
45
- - name: TypeScript type check
46
- run: yarn typescript
47
- android:
48
- runs-on: ubuntu-18.04
49
- strategy:
50
- matrix:
51
- node-version: [12]
52
- steps:
53
- - uses: actions/checkout@v2
54
- - uses: actions/setup-node@v1
55
- with:
56
- node-version: ${{ matrix.node-version }}
57
- - name: Get yarn cache
58
- id: yarn-cache
59
- run: echo "::set-output name=dir::$(yarn cache dir)"
60
- - uses: actions/cache@v2
61
- with:
62
- path: ${{ steps.yarn-cache.outputs.dir }}
63
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
64
- - name: Install Dependencies
65
- run: yarn && yarn bootstrap
66
- - name: Build Android Example App and Library
67
- run: cd example/android && ./gradlew clean assembleDebug
68
- ios:
69
- runs-on: macos-latest
70
- strategy:
71
- matrix:
72
- node-version: [12]
73
- steps:
74
- - uses: actions/checkout@v2
75
- - uses: actions/setup-node@v1
76
- with:
77
- node-version: ${{ matrix.node-version }}
78
- - name: Get yarn cache
79
- id: yarn-cache
80
- run: echo "::set-output name=dir::$(yarn cache dir)"
81
- - uses: actions/cache@v2
82
- with:
83
- path: ${{ steps.yarn-cache.outputs.dir }}
84
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
85
- - name: Install Dependencies
86
- run: yarn && yarn bootstrap
87
- - name: Install Podfiles
88
- run: cd example && npx pod-install
89
- - name: Build example app
90
- run: cd example && yarn ios
package/.gitignore DELETED
@@ -1,60 +0,0 @@
1
- # OSX
2
- #
3
- .DS_Store
4
-
5
- # XDE
6
- .expo/
7
-
8
- # VSCode
9
- .vscode/
10
- jsconfig.json
11
-
12
- # Xcode
13
- #
14
- build/
15
- *.pbxuser
16
- !default.pbxuser
17
- *.mode1v3
18
- !default.mode1v3
19
- *.mode2v3
20
- !default.mode2v3
21
- *.perspectivev3
22
- !default.perspectivev3
23
- xcuserdata
24
- *.xccheckout
25
- *.moved-aside
26
- DerivedData
27
- *.hmap
28
- *.ipa
29
- *.xcuserstate
30
- project.xcworkspace
31
-
32
- # Android/IJ
33
- #
34
- .idea
35
- .gradle
36
- local.properties
37
- android.iml
38
-
39
- # Cocoapods
40
- #
41
- example/ios/Pods
42
-
43
- # node.js
44
- #
45
- node_modules/
46
- npm-debug.log
47
- yarn-debug.log
48
- yarn-error.log
49
-
50
- # BUCK
51
- buck-out/
52
- \.buckd/
53
- android/app/libs
54
- android/keystores/debug.keystore
55
-
56
- # Expo
57
- .expo/*
58
-
59
- # generated by bob
60
- lib/