expo-screen-orientation 9.0.8 → 9.0.9-canary-20251205-756eb7a
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/CHANGELOG.md +3 -1
- package/android/build.gradle +2 -2
- package/build/ExpoScreenOrientation.web.d.ts +1 -0
- package/build/ExpoScreenOrientation.web.d.ts.map +1 -1
- package/build/ExpoScreenOrientation.web.js +2 -1
- package/build/ExpoScreenOrientation.web.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.module → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.module} +8 -8
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.pom → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha512 +1 -1
- package/package.json +4 -5
- package/src/ExpoScreenOrientation.web.ts +3 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8-sources.jar → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8-sources.jar.md5 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8-sources.jar.sha1 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8-sources.jar.sha256 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8-sources.jar.sha512 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.aar → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.aar.md5 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.aar.sha1 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.aar.sha256 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.8/expo.modules.screenorientation-9.0.8.aar.sha512 → 9.0.9-canary-20251205-756eb7a/expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
### 🐛 Bug fixes
|
|
10
10
|
|
|
11
|
+
- [web] fix undeclared `listener` reference ([#41441](https://github.com/expo/expo/pull/41441) by [@vonovak](https://github.com/vonovak))
|
|
12
|
+
|
|
11
13
|
### 💡 Others
|
|
12
14
|
|
|
13
|
-
## 9.0.8
|
|
15
|
+
## 9.0.8 - 2025-12-05
|
|
14
16
|
|
|
15
17
|
_This version does not introduce any user-facing changes._
|
|
16
18
|
|
package/android/build.gradle
CHANGED
|
@@ -4,12 +4,12 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '9.0.
|
|
7
|
+
version = '9.0.9-canary-20251205-756eb7a'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.screenorientation"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 7
|
|
13
|
-
versionName '9.0.
|
|
13
|
+
versionName '9.0.9-canary-20251205-756eb7a'
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -11,6 +11,7 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
declare class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
|
|
13
13
|
orientation: ScreenOrientation | null;
|
|
14
|
+
listener: (() => void) | undefined;
|
|
14
15
|
emitOrientationEvent(): Promise<void>;
|
|
15
16
|
startObserving(): void;
|
|
16
17
|
stopObserving(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoScreenOrientation.web.d.ts","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAElB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AA2CnC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9C,cAAc,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QAEvC,oBAAoB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC7C,mBAAmB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC5C,iBAAiB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;KAC3C;CACF;AA+CD,cAAM,qBAAsB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;IACrE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAE5B;
|
|
1
|
+
{"version":3,"file":"ExpoScreenOrientation.web.d.ts","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAElB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AA2CnC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9C,cAAc,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QAEvC,oBAAoB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC7C,mBAAmB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC5C,iBAAiB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;KAC3C;CACF;AA+CD,cAAM,qBAAsB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;IACrE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAE5B;IACT,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAE7B,oBAAoB;IAU1B,cAAc;IAUd,aAAa,IAAI,IAAI;IASf,4BAA4B,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAGhF,+BAA+B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAG9D,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;IAQ3C,SAAS,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1D,iBAAiB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CA8BnC;;AAED,wBAAiF"}
|
|
@@ -63,6 +63,7 @@ class ExpoScreenOrientation extends NativeModule {
|
|
|
63
63
|
orientation = Platform.canUseViewport
|
|
64
64
|
? screen.orientation || screen.msOrientation || null
|
|
65
65
|
: null;
|
|
66
|
+
listener;
|
|
66
67
|
async emitOrientationEvent() {
|
|
67
68
|
const [orientationLock, orientation] = await Promise.all([
|
|
68
69
|
getOrientationLockAsync(),
|
|
@@ -85,7 +86,7 @@ class ExpoScreenOrientation extends NativeModule {
|
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
stopObserving() {
|
|
88
|
-
if (Platform.canUseEventListeners) {
|
|
89
|
+
if (Platform.canUseEventListeners && this.listener) {
|
|
89
90
|
if (this.orientation && this.orientation.removeEventListener) {
|
|
90
91
|
this.orientation.removeEventListener('change', this.listener);
|
|
91
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoScreenOrientation.web.js","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAEnC,MAAM,uBAAuB,GAEzB;IACF,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO;IACrD,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,GAAG;IAC7C,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,QAAQ;IACvD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,gBAAgB;IAClE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,kBAAkB;IACtE,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,SAAS;IACzD,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC,iBAAiB;IACtE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,kBAAkB,CAAC,mBAAmB;CAC1E,CAAC;AAEF,MAAM,mBAAmB,GAErB;IACF,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,WAAW;IAC1D,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,aAAa;IAC9D,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAC,cAAc;IAC9D,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,WAAW,CAAC,eAAe;CA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iF;QACjF,IACE,MAAM,CAAC,WAAW;YAClB,QAAQ,IAAI,MAAM,CAAC,WAAW;YAC9B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,UAAU,EAC/C,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,iFAAiF;QACjF,MAAM,sBAAsB,GAC1B,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,oBAAoB,IAAI,MAAM,CAAC,mBAAmB,CAAC;QAExF,sCAAsC;QACtC,iFAAiF;QACjF,IAAI,OAAO,sBAAsB,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { NativeModule, Platform, registerWebModule } from 'expo-modules-core';\n\nimport { getOrientationLockAsync, getOrientationAsync } from './ScreenOrientation';\nimport {\n Orientation,\n OrientationLock,\n WebOrientationLock,\n WebOrientation,\n ExpoOrientationEvents,\n} from './ScreenOrientation.types';\n\nconst OrientationLockAPIToWeb: {\n [lock: string]: WebOrientationLock;\n} = {\n [OrientationLock.DEFAULT]: WebOrientationLock.NATURAL,\n [OrientationLock.ALL]: WebOrientationLock.ANY,\n [OrientationLock.PORTRAIT]: WebOrientationLock.PORTRAIT,\n [OrientationLock.PORTRAIT_UP]: WebOrientationLock.PORTRAIT_PRIMARY,\n [OrientationLock.PORTRAIT_DOWN]: WebOrientationLock.PORTRAIT_SECONDARY,\n [OrientationLock.LANDSCAPE]: WebOrientationLock.LANDSCAPE,\n [OrientationLock.LANDSCAPE_LEFT]: WebOrientationLock.LANDSCAPE_PRIMARY,\n [OrientationLock.LANDSCAPE_RIGHT]: WebOrientationLock.LANDSCAPE_SECONDARY,\n};\n\nconst OrientationWebToAPI: {\n [orientationWeb: string]: Orientation;\n} = {\n [WebOrientation.PORTRAIT_PRIMARY]: Orientation.PORTRAIT_UP,\n [WebOrientation.PORTRAIT_SECONDARY]: Orientation.PORTRAIT_DOWN,\n [WebOrientation.LANDSCAPE_PRIMARY]: Orientation.LANDSCAPE_LEFT,\n [WebOrientation.LANDSCAPE_SECONDARY]: Orientation.LANDSCAPE_RIGHT,\n};\n\ndeclare const window: Window;\n\nconst screen: Screen = Platform.canUseViewport ? window.screen : ({} as Screen);\n\nfunction _convertToLegacyOrientationLock(orientationLock: WebOrientationLock) {\n switch (orientationLock) {\n case WebOrientationLock.UNKNOWN:\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock to be converted.`\n );\n case WebOrientationLock.ANY:\n return ['portrait', 'landscape'];\n case WebOrientationLock.NATURAL:\n return 'default';\n default:\n return orientationLock;\n }\n}\n\ndeclare global {\n interface Screen {\n msOrientation?: Screen['orientation']['type'];\n mozOrientation?: Screen['orientation'];\n\n mozUnlockOrientation?(): boolean | undefined;\n msUnlockOrientation?(): boolean | undefined;\n unlockOrientation?(): boolean | undefined;\n }\n}\n\nasync function _lockAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n if (webOrientationLock === WebOrientationLock.UNKNOWN) {\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock that can be applied to the device.`\n );\n }\n\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock\n if (\n screen.orientation &&\n 'lock' in screen.orientation &&\n typeof screen.orientation.lock === 'function'\n ) {\n await screen.orientation.lock(webOrientationLock);\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n const _legacyLockUniversal:\n | undefined\n | ((orientation: ReturnType<typeof _convertToLegacyOrientationLock>) => boolean) =\n // @ts-expect-error - These legacy APIs are removed from the types\n screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n if (typeof _legacyLockUniversal === 'function') {\n const legacyLock = _convertToLegacyOrientationLock(webOrientationLock);\n const isSuccess = _legacyLockUniversal.call(screen, legacyLock);\n if (!isSuccess) {\n throw new Error(\n `Applying orientation lock: ${JSON.stringify(webOrientationLock)} to device was denied`\n );\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support locking screen orientation.`\n );\n}\n\nlet _lastWebOrientationLock: WebOrientationLock = WebOrientationLock.UNKNOWN;\n\nclass ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {\n orientation: ScreenOrientation | null = Platform.canUseViewport\n ? screen.orientation || (screen as any).msOrientation || null\n : null;\n async emitOrientationEvent() {\n const [orientationLock, orientation] = await Promise.all([\n getOrientationLockAsync(),\n getOrientationAsync(),\n ]);\n this.emit('expoDidUpdateDimensions', {\n orientationLock,\n orientationInfo: { orientation },\n });\n }\n startObserving() {\n this.listener = () => this.emitOrientationEvent();\n if (Platform.canUseEventListeners) {\n if (this.orientation && this.orientation.addEventListener) {\n this.orientation.addEventListener('change', this.listener);\n } else {\n window.addEventListener('orientationchange', this.listener);\n }\n }\n }\n stopObserving(): void {\n if (Platform.canUseEventListeners) {\n if (this.orientation && this.orientation.removeEventListener) {\n this.orientation.removeEventListener('change', this.listener);\n } else {\n window.removeEventListener('orientationchange', this.listener);\n }\n }\n }\n async supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean> {\n return orientationLock in OrientationLockAPIToWeb;\n }\n async getPlatformOrientationLockAsync(): Promise<WebOrientationLock> {\n return _lastWebOrientationLock;\n }\n async getOrientationAsync(): Promise<Orientation> {\n const webOrientation =\n screen['msOrientation'] || (screen.orientation || screen['mozOrientation'] || {}).type;\n if (!webOrientation) {\n return Orientation.UNKNOWN;\n }\n return OrientationWebToAPI[webOrientation];\n }\n async lockAsync(orientationLock: OrientationLock): Promise<void> {\n const webOrientationLock = OrientationLockAPIToWeb[orientationLock];\n if (!webOrientationLock) {\n throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);\n }\n await _lockAsync(webOrientationLock);\n }\n async lockPlatformAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n await _lockAsync(webOrientationLock);\n _lastWebOrientationLock = webOrientationLock;\n }\n async unlockAsync(): Promise<void> {\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock\n if (\n screen.orientation &&\n 'unlock' in screen.orientation &&\n typeof screen.orientation.unlock === 'function'\n ) {\n screen.orientation.unlock();\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n const _legacyUnlockUniversal: undefined | (() => boolean | undefined) =\n screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n if (typeof _legacyUnlockUniversal === 'function') {\n const isSuccess = _legacyUnlockUniversal.call(screen);\n if (!isSuccess) {\n throw new Error(`Unlocking screen orientation on device was denied`);\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support unlocking screen orientation.`\n );\n }\n}\n\nexport default registerWebModule(ExpoScreenOrientation, 'ExpoScreenOrientation');\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoScreenOrientation.web.js","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EACL,WAAW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AC,oBAAoB,IAAI,MAAM,CAAC,mBAAmB,CAAC;QAExF,sCAAsC;QACtC,iFAAiF;QACjF,IAAI,OAAO,sBAAsB,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { NativeModule, Platform, registerWebModule } from 'expo-modules-core';\n\nimport { getOrientationLockAsync, getOrientationAsync } from './ScreenOrientation';\nimport {\n Orientation,\n OrientationLock,\n WebOrientationLock,\n WebOrientation,\n ExpoOrientationEvents,\n} from './ScreenOrientation.types';\n\nconst OrientationLockAPIToWeb: {\n [lock: string]: WebOrientationLock;\n} = {\n [OrientationLock.DEFAULT]: WebOrientationLock.NATURAL,\n [OrientationLock.ALL]: WebOrientationLock.ANY,\n [OrientationLock.PORTRAIT]: WebOrientationLock.PORTRAIT,\n [OrientationLock.PORTRAIT_UP]: WebOrientationLock.PORTRAIT_PRIMARY,\n [OrientationLock.PORTRAIT_DOWN]: WebOrientationLock.PORTRAIT_SECONDARY,\n [OrientationLock.LANDSCAPE]: WebOrientationLock.LANDSCAPE,\n [OrientationLock.LANDSCAPE_LEFT]: WebOrientationLock.LANDSCAPE_PRIMARY,\n [OrientationLock.LANDSCAPE_RIGHT]: WebOrientationLock.LANDSCAPE_SECONDARY,\n};\n\nconst OrientationWebToAPI: {\n [orientationWeb: string]: Orientation;\n} = {\n [WebOrientation.PORTRAIT_PRIMARY]: Orientation.PORTRAIT_UP,\n [WebOrientation.PORTRAIT_SECONDARY]: Orientation.PORTRAIT_DOWN,\n [WebOrientation.LANDSCAPE_PRIMARY]: Orientation.LANDSCAPE_LEFT,\n [WebOrientation.LANDSCAPE_SECONDARY]: Orientation.LANDSCAPE_RIGHT,\n};\n\ndeclare const window: Window;\n\nconst screen: Screen = Platform.canUseViewport ? window.screen : ({} as Screen);\n\nfunction _convertToLegacyOrientationLock(orientationLock: WebOrientationLock) {\n switch (orientationLock) {\n case WebOrientationLock.UNKNOWN:\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock to be converted.`\n );\n case WebOrientationLock.ANY:\n return ['portrait', 'landscape'];\n case WebOrientationLock.NATURAL:\n return 'default';\n default:\n return orientationLock;\n }\n}\n\ndeclare global {\n interface Screen {\n msOrientation?: Screen['orientation']['type'];\n mozOrientation?: Screen['orientation'];\n\n mozUnlockOrientation?(): boolean | undefined;\n msUnlockOrientation?(): boolean | undefined;\n unlockOrientation?(): boolean | undefined;\n }\n}\n\nasync function _lockAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n if (webOrientationLock === WebOrientationLock.UNKNOWN) {\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock that can be applied to the device.`\n );\n }\n\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock\n if (\n screen.orientation &&\n 'lock' in screen.orientation &&\n typeof screen.orientation.lock === 'function'\n ) {\n await screen.orientation.lock(webOrientationLock);\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n const _legacyLockUniversal:\n | undefined\n | ((orientation: ReturnType<typeof _convertToLegacyOrientationLock>) => boolean) =\n // @ts-expect-error - These legacy APIs are removed from the types\n screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n if (typeof _legacyLockUniversal === 'function') {\n const legacyLock = _convertToLegacyOrientationLock(webOrientationLock);\n const isSuccess = _legacyLockUniversal.call(screen, legacyLock);\n if (!isSuccess) {\n throw new Error(\n `Applying orientation lock: ${JSON.stringify(webOrientationLock)} to device was denied`\n );\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support locking screen orientation.`\n );\n}\n\nlet _lastWebOrientationLock: WebOrientationLock = WebOrientationLock.UNKNOWN;\n\nclass ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {\n orientation: ScreenOrientation | null = Platform.canUseViewport\n ? screen.orientation || (screen as any).msOrientation || null\n : null;\n listener: (() => void) | undefined;\n\n async emitOrientationEvent() {\n const [orientationLock, orientation] = await Promise.all([\n getOrientationLockAsync(),\n getOrientationAsync(),\n ]);\n this.emit('expoDidUpdateDimensions', {\n orientationLock,\n orientationInfo: { orientation },\n });\n }\n startObserving() {\n this.listener = () => this.emitOrientationEvent();\n if (Platform.canUseEventListeners) {\n if (this.orientation && this.orientation.addEventListener) {\n this.orientation.addEventListener('change', this.listener);\n } else {\n window.addEventListener('orientationchange', this.listener);\n }\n }\n }\n stopObserving(): void {\n if (Platform.canUseEventListeners && this.listener) {\n if (this.orientation && this.orientation.removeEventListener) {\n this.orientation.removeEventListener('change', this.listener);\n } else {\n window.removeEventListener('orientationchange', this.listener);\n }\n }\n }\n async supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean> {\n return orientationLock in OrientationLockAPIToWeb;\n }\n async getPlatformOrientationLockAsync(): Promise<WebOrientationLock> {\n return _lastWebOrientationLock;\n }\n async getOrientationAsync(): Promise<Orientation> {\n const webOrientation =\n screen['msOrientation'] || (screen.orientation || screen['mozOrientation'] || {}).type;\n if (!webOrientation) {\n return Orientation.UNKNOWN;\n }\n return OrientationWebToAPI[webOrientation];\n }\n async lockAsync(orientationLock: OrientationLock): Promise<void> {\n const webOrientationLock = OrientationLockAPIToWeb[orientationLock];\n if (!webOrientationLock) {\n throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);\n }\n await _lockAsync(webOrientationLock);\n }\n async lockPlatformAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n await _lockAsync(webOrientationLock);\n _lastWebOrientationLock = webOrientationLock;\n }\n async unlockAsync(): Promise<void> {\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock\n if (\n screen.orientation &&\n 'unlock' in screen.orientation &&\n typeof screen.orientation.unlock === 'function'\n ) {\n screen.orientation.unlock();\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n const _legacyUnlockUniversal: undefined | (() => boolean | undefined) =\n screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n if (typeof _legacyUnlockUniversal === 'function') {\n const isSuccess = _legacyUnlockUniversal.call(screen);\n if (!isSuccess) {\n throw new Error(`Unlocking screen orientation on device was denied`);\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support unlocking screen orientation.`\n );\n }\n}\n\nexport default registerWebModule(ExpoScreenOrientation, 'ExpoScreenOrientation');\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.screenorientation",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.0.9-canary-20251205-756eb7a",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"createdBy": {
|
|
12
12
|
"gradle": {
|
|
13
|
-
"version": "
|
|
13
|
+
"version": "9.0.0"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"variants": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.screenorientation-9.0.
|
|
28
|
-
"url": "expo.modules.screenorientation-9.0.
|
|
27
|
+
"name": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar",
|
|
28
|
+
"url": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar",
|
|
29
29
|
"size": 36366,
|
|
30
30
|
"sha512": "a162b7dfa0781524677151cb8a3549e48d6d326c77f0073808171b0efdd5021abceaaf6e7f1a5d6a8fe926ef38126b0bc40667dd3f8a7ba3b00c9171d4194cff",
|
|
31
31
|
"sha256": "4f7df2e05f65bf63024bd37b36dc9b1541ff912cd0c9ab8c3804d51f727268cd",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
],
|
|
54
54
|
"files": [
|
|
55
55
|
{
|
|
56
|
-
"name": "expo.modules.screenorientation-9.0.
|
|
57
|
-
"url": "expo.modules.screenorientation-9.0.
|
|
56
|
+
"name": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar",
|
|
57
|
+
"url": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a.aar",
|
|
58
58
|
"size": 36366,
|
|
59
59
|
"sha512": "a162b7dfa0781524677151cb8a3549e48d6d326c77f0073808171b0efdd5021abceaaf6e7f1a5d6a8fe926ef38126b0bc40667dd3f8a7ba3b00c9171d4194cff",
|
|
60
60
|
"sha256": "4f7df2e05f65bf63024bd37b36dc9b1541ff912cd0c9ab8c3804d51f727268cd",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
76
|
-
"name": "expo.modules.screenorientation-9.0.
|
|
77
|
-
"url": "expo.modules.screenorientation-9.0.
|
|
76
|
+
"name": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar",
|
|
77
|
+
"url": "expo.modules.screenorientation-9.0.9-canary-20251205-756eb7a-sources.jar",
|
|
78
78
|
"size": 5194,
|
|
79
79
|
"sha512": "e06be0d0236539250b81b1d5670d89f70600b03c82fa53c245602afdcb2bab06d04d42e6dd85e9686867d069a8b09dd3fbc04f562bc1760e33f68ea614b2ec42",
|
|
80
80
|
"sha256": "d63ace679c73e409ffd1706ac43973134e9151254bf644d73a33c27539db1037",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c795c4a14c80ec3748fc85e5982ba36c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
276ea9fe852468f052864964a913ef1362f113d4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ca1afd7882be49fa033ff22273c03e360f372a180d42f9667b4b6fd77b5e491c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7dde05ec8cb4239c242a3813e29e0d3da3f191f57d87f9179e3645cd1a18596445b03f9999c6b920c3bc24fa945f26b4755c7164b532d3c4c6a8efa02003dcdf
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.screenorientation</artifactId>
|
|
12
|
-
<version>9.0.
|
|
12
|
+
<version>9.0.9-canary-20251205-756eb7a</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.screenorientation</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c8d238f71690f0460c94b0e1c096189d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
284069226b87bf8ae6203374152a38ade5c610cf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
73af26858841762926eac9286f2a13f36a0d1f817b372b5a9437d96937705c45
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4f9502f6ee3a939f6201a25b438dc487075c34c1e7e5e239fa98da109b70e78e72e01bb8bd838c18ee0e13e8f9ca54358410129b8f2aed6e287774af2f1552b6
|
package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.screenorientation</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>9.0.
|
|
7
|
-
<release>9.0.
|
|
6
|
+
<latest>9.0.9-canary-20251205-756eb7a</latest>
|
|
7
|
+
<release>9.0.9-canary-20251205-756eb7a</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>9.0.
|
|
9
|
+
<version>9.0.9-canary-20251205-756eb7a</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20251205115850</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7c5c549cee411f7ba94d897ea66372ac
|
package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
128efa9f5c1c394e8db1cc3d5ab3b6c139610205
|
package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ebbb17d19c9e5159e1134f8c4ec7d524ffffed26ba8b26b58e6f40ed88c67f6f
|
package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0da7d08a28704318bee866e1ee9a706af5ddf8a830b720c23ee1b1052399e7382b09b2951f9fbba86b01da12491c8b5fd3a485e15cedb4b22fa47fd7a1add44f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-screen-orientation",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.9-canary-20251205-756eb7a",
|
|
4
4
|
"description": "Expo universal module for managing device's screen orientation",
|
|
5
5
|
"main": "build/ScreenOrientation.js",
|
|
6
6
|
"types": "build/ScreenOrientation.d.ts",
|
|
@@ -36,11 +36,10 @@
|
|
|
36
36
|
"preset": "expo-module-scripts"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"expo-module-scripts": "
|
|
39
|
+
"expo-module-scripts": "5.1.0-canary-20251205-756eb7a"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"expo": "
|
|
42
|
+
"expo": "55.0.0-canary-20251205-756eb7a",
|
|
43
43
|
"react-native": "*"
|
|
44
|
-
}
|
|
45
|
-
"gitHead": "172a69f5f70c1d0e043e1532f924de97210cabc3"
|
|
44
|
+
}
|
|
46
45
|
}
|
|
@@ -110,6 +110,8 @@ class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
|
|
|
110
110
|
orientation: ScreenOrientation | null = Platform.canUseViewport
|
|
111
111
|
? screen.orientation || (screen as any).msOrientation || null
|
|
112
112
|
: null;
|
|
113
|
+
listener: (() => void) | undefined;
|
|
114
|
+
|
|
113
115
|
async emitOrientationEvent() {
|
|
114
116
|
const [orientationLock, orientation] = await Promise.all([
|
|
115
117
|
getOrientationLockAsync(),
|
|
@@ -131,7 +133,7 @@ class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
|
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
stopObserving(): void {
|
|
134
|
-
if (Platform.canUseEventListeners) {
|
|
136
|
+
if (Platform.canUseEventListeners && this.listener) {
|
|
135
137
|
if (this.orientation && this.orientation.removeEventListener) {
|
|
136
138
|
this.orientation.removeEventListener('change', this.listener);
|
|
137
139
|
} else {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
94317bab02d15262a966b24cb1cd1995
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6b539a5c899d32085c1bcb4a36a5c04093dc790a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
36002dc6c73fec6d5bcec2a06b3e788b71776794b447c3b209f92c6cd1c2b09f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0762523e11c9f6feb1175437762753d91a77f273459b4028df9a4099bfaaa445c924b6d24a1956326a3f7a92681ac7083d75c993d0b2288e626d2ab9f8062373
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ad55732b74716bb410aae5c7243706d1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9cfb513ade9fe600a8901a27115cb63e955a0cfe
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3d37c343972b9dce6fb7b6135cb349e0c5e860a149e3f99a40c83beede152982
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7c4101b209ec05a073392f808dca97e2bb06055cc3c1479dbd728fc3eb3b516c887218ab2677761f877eabe5c56d52f2197ff888a1fb60d712b00b54bac23f77
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|