@react-native-menu/menu 0.5.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.
Files changed (40) hide show
  1. package/.editorconfig +15 -0
  2. package/.gitattributes +3 -0
  3. package/.github/CODEOWNERS +1 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. package/.github/dependabot.yml +51 -0
  6. package/.github/workflows/ci.yml +90 -0
  7. package/.gitignore +60 -0
  8. package/CONTRIBUTING.md +184 -0
  9. package/android/gradle.properties +3 -3
  10. package/babel.config.js +3 -0
  11. package/example/.gitignore +14 -0
  12. package/example/.watchmanconfig +1 -0
  13. package/example/android/build.gradle +14 -0
  14. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  15. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  16. package/example/android/gradle.properties +6 -0
  17. package/example/android/gradlew +185 -0
  18. package/example/android/gradlew.bat +89 -0
  19. package/example/android/settings.gradle +12 -0
  20. package/example/app.json +28 -0
  21. package/example/babel.config.js +3 -0
  22. package/example/index.tsx +5 -0
  23. package/example/ios/Podfile +7 -0
  24. package/example/ios/Podfile.lock +515 -0
  25. package/example/metro.config.js +44 -0
  26. package/example/package.json +34 -0
  27. package/example/react-native.config.js +61 -0
  28. package/example/src/App.tsx +187 -0
  29. package/example/yarn.lock +6542 -0
  30. package/ios/ActionSheetView.swift +3 -8
  31. package/lib/commonjs/UIMenuView.js +2 -2
  32. package/lib/commonjs/types.js +4 -0
  33. package/lib/module/types.js +1 -1
  34. package/lib/typescript/example/index.d.ts +1 -0
  35. package/lib/typescript/example/src/App.d.ts +2 -0
  36. package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
  37. package/package.json +5 -4
  38. package/src/__tests__/index.test.tsx +1 -0
  39. package/tsconfig.json +27 -0
  40. package/yarn.lock +9701 -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] = [];
@@ -53,7 +48,7 @@ class ActionSheetView: UIView {
53
48
  let alert = UIAlertController(title: _title, message: nil, preferredStyle: .actionSheet)
54
49
 
55
50
  self._actions.forEach({action in
56
- alert.addAction(action)
51
+ alert.addAction(action.copy() as! UIAlertAction)
57
52
  })
58
53
 
59
54
  alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
@@ -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 cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
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
@@ -1,2 +1,6 @@
1
1
  "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=types.js.map
@@ -1,2 +1,2 @@
1
-
1
+ export {};
2
2
  //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const App: () => JSX.Element;
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-menu/menu",
3
- "version": "0.5.1",
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",
@@ -47,15 +47,16 @@
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.64.10",
51
- "eslint": "7.29.0",
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": "^26.6.3",
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
58
  "react-native": "0.64.1",
59
+ "react-native-test-app": "^0.7.5",
59
60
  "release-it": "^14.10.0",
60
61
  "typescript": "^4.1.3"
61
62
  },
@@ -0,0 +1 @@
1
+ it.todo('write a test');
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
+ }