@react-native-menu/menu 1.0.3 → 1.1.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.
- package/README.md +9 -9
- package/android/build.gradle +1 -1
- package/android/gradle.properties +1 -1
- package/lib/commonjs/utils.js +1 -0
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/utils.js +1 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/types.d.ts +4 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/types.ts +5 -5
- package/src/utils.ts +1 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Android PopupMenu and iOS14+ UIMenu components for react-native.
|
|
|
6
6
|
Falls back to ActionSheet for versions below iOS14.
|
|
7
7
|
|
|
8
8
|
| Android | iOS 14+ | iOS 13 |
|
|
9
|
-
|
|
9
|
+
|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
|
10
10
|
| <img src="https://user-images.githubusercontent.com/6936373/112418277-827ac380-8d6c-11eb-96e2-324487ff3dde.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/112418272-80b10000-8d6c-11eb-9edb-f91eeff0877e.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/98471162-cb9f0080-222d-11eb-89ef-9342a1f10893.png" width="320" /> |
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
@@ -144,7 +144,7 @@ const App = () => {
|
|
|
144
144
|
The title of the menu.
|
|
145
145
|
|
|
146
146
|
| Type | Required |
|
|
147
|
-
|
|
147
|
+
|--------|----------|
|
|
148
148
|
| string | Yes |
|
|
149
149
|
|
|
150
150
|
### `isAnchoredToRight` (Android only)
|
|
@@ -152,7 +152,7 @@ The title of the menu.
|
|
|
152
152
|
Boolean determining if menu should anchored to right or left corner of parent view.
|
|
153
153
|
|
|
154
154
|
| Type | Required |
|
|
155
|
-
|
|
155
|
+
|---------|----------|
|
|
156
156
|
| boolean | No |
|
|
157
157
|
|
|
158
158
|
### `shouldOpenOnLongPress`
|
|
@@ -160,7 +160,7 @@ Boolean determining if menu should anchored to right or left corner of parent vi
|
|
|
160
160
|
Boolean determining if menu should open after long press or on normal press
|
|
161
161
|
|
|
162
162
|
| Type | Required |
|
|
163
|
-
|
|
163
|
+
|---------|----------|
|
|
164
164
|
| boolean | No |
|
|
165
165
|
|
|
166
166
|
### `actions`
|
|
@@ -168,16 +168,16 @@ Boolean determining if menu should open after long press or on normal press
|
|
|
168
168
|
Actions to be displayed in the menu.
|
|
169
169
|
|
|
170
170
|
| Type | Required |
|
|
171
|
-
|
|
171
|
+
|--------------|----------|
|
|
172
172
|
| MenuAction[] | Yes |
|
|
173
173
|
|
|
174
174
|
### `themeVariant` (iOS only)
|
|
175
175
|
|
|
176
176
|
String to override theme of the menu. If you want to control theme universally across your app, [see this package](https://github.com/vonovak/react-native-theme-control).
|
|
177
177
|
|
|
178
|
-
| Type
|
|
179
|
-
|
|
180
|
-
| enum('light', 'dark') | No
|
|
178
|
+
| Type | Required |
|
|
179
|
+
|-----------------------|----------|
|
|
180
|
+
| enum('light', 'dark') | No |
|
|
181
181
|
|
|
182
182
|
#### `MenuAction`
|
|
183
183
|
|
|
@@ -282,7 +282,7 @@ Callback function that will be called when selecting a menu item.
|
|
|
282
282
|
It will contain id of the given action.
|
|
283
283
|
|
|
284
284
|
| Type | Required |
|
|
285
|
-
|
|
285
|
+
|-------------------------|----------|
|
|
286
286
|
| ({nativeEvent}) => void | No |
|
|
287
287
|
|
|
288
288
|
## Contributing
|
package/android/build.gradle
CHANGED
|
@@ -56,7 +56,7 @@ android {
|
|
|
56
56
|
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
57
57
|
|
|
58
58
|
defaultConfig {
|
|
59
|
-
minSdkVersion
|
|
59
|
+
minSdkVersion 23
|
|
60
60
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
61
61
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
62
62
|
versionCode 1
|
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;EACrC,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACnC,MAAME,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAACH,CAAC,CAAC;
|
|
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;EACrC,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACnC,MAAME,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAACH,CAAC,CAAC;IAC9B;IACAD,IAAI,GAAG,CAACA,IAAI,IAAI,CAAC,IAAIA,IAAI,GAAGG,IAAI;EAClC;EACA,OAAOH,IAAI;AACb;;AAEA;AACO,SAASK,UAAUA,CAACC,GAAwB,EAAU;EAC3D,IAAI,CAACA,GAAG,EAAE;IACR,OAAO,EAAE;EACX;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;AACrB"}
|
package/lib/module/utils.js
CHANGED
package/lib/module/utils.js.map
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;EACrC,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACnC,MAAME,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAACH,CAAC,CAAC;
|
|
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;EACrC,IAAIC,IAAI,GAAG,CAAC;EACZ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,GAAG,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACnC,MAAME,IAAI,GAAGJ,GAAG,CAACK,UAAU,CAACH,CAAC,CAAC;IAC9B;IACAD,IAAI,GAAG,CAACA,IAAI,IAAI,CAAC,IAAIA,IAAI,GAAGG,IAAI;EAClC;EACA,OAAOH,IAAI;AACb;;AAEA;AACA,OAAO,SAASK,UAAUA,CAACC,GAAwB,EAAU;EAC3D,IAAI,CAACA,GAAG,EAAE;IACR,OAAO,EAAE;EACX;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;AACrB"}
|
|
@@ -92,10 +92,10 @@ export type MenuAction = {
|
|
|
92
92
|
*/
|
|
93
93
|
displayInline?: boolean;
|
|
94
94
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
* (iOS 16+ only)
|
|
96
|
+
* The preferred size of this menu's child elements.
|
|
97
|
+
* @platform iOS
|
|
98
|
+
*/
|
|
99
99
|
preferredElementSize?: 'small' | 'medium' | 'large';
|
|
100
100
|
};
|
|
101
101
|
type MenuComponentPropsBase = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,KAAK,SAAS,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;;;OAI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,EAAE,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAYA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAY3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-menu/menu",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "UIMenu component for react-native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react": "18.2.0",
|
|
65
65
|
"react-native": "^0.73.0",
|
|
66
66
|
"react-native-builder-bob": "^0.23.2",
|
|
67
|
-
"react-native-test-app": "^3.2
|
|
67
|
+
"react-native-test-app": "^3.7.2",
|
|
68
68
|
"release-it": "^17.2.0",
|
|
69
69
|
"typescript": "5.4.5"
|
|
70
70
|
},
|
package/src/types.ts
CHANGED
|
@@ -99,12 +99,12 @@ export type MenuAction = {
|
|
|
99
99
|
/**
|
|
100
100
|
* Whether subactions should be inline (separated by divider) or nested (sub menu)
|
|
101
101
|
*/
|
|
102
|
-
displayInline?: boolean;
|
|
102
|
+
displayInline?: boolean;
|
|
103
103
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
* (iOS 16+ only)
|
|
105
|
+
* The preferred size of this menu's child elements.
|
|
106
|
+
* @platform iOS
|
|
107
|
+
*/
|
|
108
108
|
preferredElementSize?: 'small' | 'medium' | 'large';
|
|
109
109
|
};
|
|
110
110
|
|