react-native-orientation-director 2.4.0 → 2.5.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 +3 -1
- package/lib/module/NativeOrientationDirector.js +5 -0
- package/lib/module/NativeOrientationDirector.js.map +1 -0
- package/package.json +33 -57
- package/lib/module/NativeOrientationDirector.ts +0 -28
- package/lib/typescript/example/src/App.d.ts +0 -2
- package/lib/typescript/example/src/App.d.ts.map +0 -1
- package/lib/typescript/example/src/AppNavigationContainer.d.ts +0 -3
- package/lib/typescript/example/src/AppNavigationContainer.d.ts.map +0 -1
- package/lib/typescript/example/src/screens/Explore.d.ts +0 -3
- package/lib/typescript/example/src/screens/Explore.d.ts.map +0 -1
- package/lib/typescript/example/src/screens/Home.d.ts +0 -3
- package/lib/typescript/example/src/screens/Home.d.ts.map +0 -1
- package/lib/typescript/example/src/screens/InnerExplore.d.ts +0 -3
- package/lib/typescript/example/src/screens/InnerExplore.d.ts.map +0 -1
- package/lib/typescript/example/src/screens/styles.d.ts +0 -51
- package/lib/typescript/example/src/screens/styles.d.ts.map +0 -1
- package/lib/typescript/lib/module/NativeOrientationDirector.d.ts +0 -17
- package/lib/typescript/lib/module/NativeOrientationDirector.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -107,7 +107,7 @@ To properly handle interface orientation changes in iOS, you need to update your
|
|
|
107
107
|
|
|
108
108
|
##### Objective-C
|
|
109
109
|
|
|
110
|
-
In your AppDelegate.
|
|
110
|
+
In your AppDelegate.mm file, import "OrientationDirector.h" and implement supportedInterfaceOrientationsForWindow method as follows:
|
|
111
111
|
|
|
112
112
|
```objc
|
|
113
113
|
#import <OrientationDirector.h>
|
|
@@ -135,6 +135,8 @@ override func application(_ application: UIApplication, supportedInterfaceOrient
|
|
|
135
135
|
}
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
Note: if you are targeting react-native > 79.x, you can omit the `override` keyword.
|
|
139
|
+
|
|
138
140
|
If you need help, you can check the example project.
|
|
139
141
|
|
|
140
142
|
## Usage
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeOrientationDirector.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA0BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-orientation-director",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "A Modern React Native library that allows you to access orientation",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
|
-
"module": "lib/module/index",
|
|
7
|
-
"types": "lib/typescript/src/index.d.ts",
|
|
8
|
-
"source": "./src/index.tsx",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./lib/typescript/src/index.d.ts",
|
|
12
|
-
"default": "./lib/module/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
16
8
|
"files": [
|
|
17
9
|
"src",
|
|
18
10
|
"lib",
|
|
@@ -23,6 +15,7 @@
|
|
|
23
15
|
"plugin/tsconfig.json",
|
|
24
16
|
"app.plugin.js",
|
|
25
17
|
"*.podspec",
|
|
18
|
+
"react-native.config.js",
|
|
26
19
|
"!ios/build",
|
|
27
20
|
"!android/build",
|
|
28
21
|
"!android/gradle",
|
|
@@ -63,32 +56,33 @@
|
|
|
63
56
|
"registry": "https://registry.npmjs.org/"
|
|
64
57
|
},
|
|
65
58
|
"devDependencies": {
|
|
66
|
-
"@commitlint/config-conventional": "^
|
|
59
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
60
|
+
"@eslint/compat": "^1.2.7",
|
|
61
|
+
"@eslint/eslintrc": "^3.3.0",
|
|
62
|
+
"@eslint/js": "^9.22.0",
|
|
67
63
|
"@evilmartians/lefthook": "^1.5.0",
|
|
68
|
-
"@react-native/
|
|
69
|
-
"@
|
|
64
|
+
"@react-native-community/cli": "15.0.0-alpha.2",
|
|
65
|
+
"@react-native/babel-preset": "0.79.2",
|
|
66
|
+
"@react-native/eslint-config": "^0.78.0",
|
|
67
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
70
68
|
"@types/jest": "^29.5.5",
|
|
71
69
|
"@types/react": "^19.0.0",
|
|
72
|
-
"
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
71
|
+
"commitlint": "^19.6.1",
|
|
73
72
|
"del-cli": "^5.1.0",
|
|
74
|
-
"eslint": "^
|
|
75
|
-
"eslint-config-prettier": "^
|
|
76
|
-
"eslint-plugin-
|
|
77
|
-
"
|
|
73
|
+
"eslint": "^9.22.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.1",
|
|
75
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
76
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
78
77
|
"jest": "^29.7.0",
|
|
79
78
|
"prettier": "^3.0.3",
|
|
80
79
|
"react": "19.0.0",
|
|
81
|
-
"react-native": "0.
|
|
82
|
-
"react-native-builder-bob": "^0.40.
|
|
83
|
-
"release-it": "^
|
|
80
|
+
"react-native": "0.79.2",
|
|
81
|
+
"react-native-builder-bob": "^0.40.10",
|
|
82
|
+
"release-it": "^17.10.0",
|
|
84
83
|
"turbo": "^1.10.7",
|
|
85
84
|
"typescript": "^5.2.2"
|
|
86
85
|
},
|
|
87
|
-
"resolutions": {
|
|
88
|
-
"@types/react": "^19.0.0",
|
|
89
|
-
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
90
|
-
"@typescript-eslint/parser": "^7.1.1"
|
|
91
|
-
},
|
|
92
86
|
"peerDependencies": {
|
|
93
87
|
"expo": ">=47.0.0",
|
|
94
88
|
"react": "*",
|
|
@@ -99,6 +93,10 @@
|
|
|
99
93
|
"optional": true
|
|
100
94
|
}
|
|
101
95
|
},
|
|
96
|
+
"resolutions": {
|
|
97
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
98
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0"
|
|
99
|
+
},
|
|
102
100
|
"workspaces": [
|
|
103
101
|
"example",
|
|
104
102
|
"plugin"
|
|
@@ -146,33 +144,6 @@
|
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
146
|
},
|
|
149
|
-
"eslintConfig": {
|
|
150
|
-
"root": true,
|
|
151
|
-
"extends": [
|
|
152
|
-
"@react-native",
|
|
153
|
-
"prettier"
|
|
154
|
-
],
|
|
155
|
-
"plugins": [
|
|
156
|
-
"prettier"
|
|
157
|
-
],
|
|
158
|
-
"rules": {
|
|
159
|
-
"react/react-in-jsx-scope": "off",
|
|
160
|
-
"prettier/prettier": [
|
|
161
|
-
"error",
|
|
162
|
-
{
|
|
163
|
-
"quoteProps": "consistent",
|
|
164
|
-
"singleQuote": true,
|
|
165
|
-
"tabWidth": 2,
|
|
166
|
-
"trailingComma": "es5",
|
|
167
|
-
"useTabs": false
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
"eslintIgnore": [
|
|
173
|
-
"node_modules/",
|
|
174
|
-
"lib/"
|
|
175
|
-
],
|
|
176
147
|
"prettier": {
|
|
177
148
|
"quoteProps": "consistent",
|
|
178
149
|
"singleQuote": true,
|
|
@@ -190,7 +161,12 @@
|
|
|
190
161
|
"esm": true
|
|
191
162
|
}
|
|
192
163
|
],
|
|
193
|
-
|
|
164
|
+
[
|
|
165
|
+
"typescript",
|
|
166
|
+
{
|
|
167
|
+
"project": "tsconfig.build.json"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
194
170
|
]
|
|
195
171
|
},
|
|
196
172
|
"codegenConfig": {
|
|
@@ -202,8 +178,8 @@
|
|
|
202
178
|
}
|
|
203
179
|
},
|
|
204
180
|
"create-react-native-library": {
|
|
205
|
-
"type": "turbo-module",
|
|
206
181
|
"languages": "kotlin-objc",
|
|
207
|
-
"
|
|
182
|
+
"type": "turbo-module",
|
|
183
|
+
"version": "0.50.2"
|
|
208
184
|
}
|
|
209
185
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export interface Spec extends TurboModule {
|
|
5
|
-
getInterfaceOrientation(): Promise<number>;
|
|
6
|
-
getDeviceOrientation(): Promise<number>;
|
|
7
|
-
lockTo(orientation: number): void;
|
|
8
|
-
unlock(): void;
|
|
9
|
-
isLocked(): boolean;
|
|
10
|
-
resetSupportedInterfaceOrientations(): void;
|
|
11
|
-
|
|
12
|
-
////////////////////////////////////
|
|
13
|
-
//
|
|
14
|
-
// ANDROID ONLY
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
isAutoRotationEnabled(): boolean;
|
|
18
|
-
enableOrientationSensors(): void;
|
|
19
|
-
disableOrientationSensors(): void;
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
addListener: (eventType: string) => void;
|
|
25
|
-
removeListeners: (count: number) => void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('OrientationDirector');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../example/src/App.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,GAAG,4CAE1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppNavigationContainer.d.ts","sourceRoot":"","sources":["../../../../example/src/AppNavigationContainer.tsx"],"names":[],"mappings":"AAOA,iBAAS,sBAAsB,4CA8B9B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Explore.d.ts","sourceRoot":"","sources":["../../../../../example/src/screens/Explore.tsx"],"names":[],"mappings":"AASA,iBAAS,OAAO,4CAwCf;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../../../../example/src/screens/Home.tsx"],"names":[],"mappings":"AAOA,iBAAS,IAAI,4CAmHZ;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InnerExplore.d.ts","sourceRoot":"","sources":["../../../../../example/src/screens/InnerExplore.tsx"],"names":[],"mappings":"AAMA,iBAAS,YAAY,4CAkBpB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export declare const homepageStyle: {
|
|
2
|
-
container: {
|
|
3
|
-
flexGrow: number;
|
|
4
|
-
padding: number;
|
|
5
|
-
};
|
|
6
|
-
marginBottom: {
|
|
7
|
-
marginBottom: number;
|
|
8
|
-
};
|
|
9
|
-
buttonsContainer: {
|
|
10
|
-
flex: number;
|
|
11
|
-
justifyContent: "center";
|
|
12
|
-
};
|
|
13
|
-
text: {
|
|
14
|
-
color: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const exploreStyle: {
|
|
18
|
-
container: {
|
|
19
|
-
flexGrow: number;
|
|
20
|
-
padding: number;
|
|
21
|
-
};
|
|
22
|
-
marginBottom: {
|
|
23
|
-
marginBottom: number;
|
|
24
|
-
};
|
|
25
|
-
text: {
|
|
26
|
-
color: string;
|
|
27
|
-
};
|
|
28
|
-
body: {
|
|
29
|
-
flex: number;
|
|
30
|
-
justifyContent: "center";
|
|
31
|
-
alignItems: "center";
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export declare const innerExploreStyle: {
|
|
35
|
-
container: {
|
|
36
|
-
flexGrow: number;
|
|
37
|
-
padding: number;
|
|
38
|
-
};
|
|
39
|
-
marginBottom: {
|
|
40
|
-
marginBottom: number;
|
|
41
|
-
};
|
|
42
|
-
text: {
|
|
43
|
-
color: string;
|
|
44
|
-
};
|
|
45
|
-
body: {
|
|
46
|
-
flex: number;
|
|
47
|
-
justifyContent: "center";
|
|
48
|
-
alignItems: "center";
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../example/src/screens/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;CAexB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CASvB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;CAE5B,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
export interface Spec extends TurboModule {
|
|
3
|
-
getInterfaceOrientation(): Promise<number>;
|
|
4
|
-
getDeviceOrientation(): Promise<number>;
|
|
5
|
-
lockTo(orientation: number): void;
|
|
6
|
-
unlock(): void;
|
|
7
|
-
isLocked(): boolean;
|
|
8
|
-
resetSupportedInterfaceOrientations(): void;
|
|
9
|
-
isAutoRotationEnabled(): boolean;
|
|
10
|
-
enableOrientationSensors(): void;
|
|
11
|
-
disableOrientationSensors(): void;
|
|
12
|
-
addListener: (eventType: string) => void;
|
|
13
|
-
removeListeners: (count: number) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const _default: Spec;
|
|
16
|
-
export default _default;
|
|
17
|
-
//# sourceMappingURL=NativeOrientationDirector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeOrientationDirector.d.ts","sourceRoot":"","sources":["../../../module/NativeOrientationDirector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,IAAI,OAAO,CAAC;IACpB,mCAAmC,IAAI,IAAI,CAAC;IAO5C,qBAAqB,IAAI,OAAO,CAAC;IACjC,wBAAwB,IAAI,IAAI,CAAC;IACjC,yBAAyB,IAAI,IAAI,CAAC;IAKlC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;;AAED,wBAA6E"}
|