expo-screen-orientation 9.0.8 → 9.0.9-canary-20251205-a1dedc6

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/CHANGELOG.md +3 -1
  2. package/android/build.gradle +2 -2
  3. package/build/ExpoScreenOrientation.web.d.ts +1 -0
  4. package/build/ExpoScreenOrientation.web.d.ts.map +1 -1
  5. package/build/ExpoScreenOrientation.web.js +2 -1
  6. package/build/ExpoScreenOrientation.web.js.map +1 -1
  7. package/expo-module.config.json +1 -1
  8. 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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.module} +8 -8
  9. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.module.md5 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.module.sha1 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.module.sha256 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.module.sha512 +1 -0
  13. 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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.pom} +1 -1
  14. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.pom.md5 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.pom.sha1 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.pom.sha256 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20251205-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.pom.sha512 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml +4 -4
  19. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.md5 +1 -1
  20. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha1 +1 -1
  21. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha256 +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha512 +1 -1
  23. package/package.json +4 -5
  24. package/src/ExpoScreenOrientation.web.ts +3 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.md5 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha1 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha256 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.module.sha512 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.md5 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha1 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha256 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.8/expo.modules.screenorientation-9.0.8.pom.sha512 +0 -1
  33. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar} +0 -0
  34. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar.md5} +0 -0
  35. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar.sha1} +0 -0
  36. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar.sha256} +0 -0
  37. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar.sha512} +0 -0
  38. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar} +0 -0
  39. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar.md5} +0 -0
  40. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar.sha1} +0 -0
  41. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar.sha256} +0 -0
  42. /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-a1dedc6/expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.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 2025-12-05
15
+ ## 9.0.8 - 2025-12-05
14
16
 
15
17
  _This version does not introduce any user-facing changes._
16
18
 
@@ -4,12 +4,12 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '9.0.8'
7
+ version = '9.0.9-canary-20251205-a1dedc6'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.screenorientation"
11
11
  defaultConfig {
12
12
  versionCode 7
13
- versionName '9.0.8'
13
+ versionName '9.0.9-canary-20251205-a1dedc6'
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;IACH,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"}
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,EA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C,kBAAkB,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,iBAAiB,CAAC,kBAAsC;QAC5D,MAAM,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACrC,uBAAuB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,WAAW;QACf,oCAAoC;QACpC,iFAAiF;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":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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 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"]}
@@ -10,7 +10,7 @@
10
10
  "publication": {
11
11
  "groupId": "host.exp.exponent",
12
12
  "artifactId": "expo.modules.screenorientation",
13
- "version": "9.0.8",
13
+ "version": "9.0.9-canary-20251205-a1dedc6",
14
14
  "repository": "local-maven-repo"
15
15
  }
16
16
  }
@@ -3,14 +3,14 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.screenorientation",
6
- "version": "9.0.8",
6
+ "version": "9.0.9-canary-20251205-a1dedc6",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
10
10
  },
11
11
  "createdBy": {
12
12
  "gradle": {
13
- "version": "8.14.3"
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.8.aar",
28
- "url": "expo.modules.screenorientation-9.0.8.aar",
27
+ "name": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar",
28
+ "url": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.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.8.aar",
57
- "url": "expo.modules.screenorientation-9.0.8.aar",
56
+ "name": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.aar",
57
+ "url": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6.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.8-sources.jar",
77
- "url": "expo.modules.screenorientation-9.0.8-sources.jar",
76
+ "name": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar",
77
+ "url": "expo.modules.screenorientation-9.0.9-canary-20251205-a1dedc6-sources.jar",
78
78
  "size": 5194,
79
79
  "sha512": "e06be0d0236539250b81b1d5670d89f70600b03c82fa53c245602afdcb2bab06d04d42e6dd85e9686867d069a8b09dd3fbc04f562bc1760e33f68ea614b2ec42",
80
80
  "sha256": "d63ace679c73e409ffd1706ac43973134e9151254bf644d73a33c27539db1037",
@@ -0,0 +1 @@
1
+ 19ff032efca6cd04555b95b3fc17a7beb7bb20fdf8eee46800b3928f4e0b303a34ae874b3e4a5eef1196b86c91cb7ae062c7c6102d626920e9a341f6afdb99af
@@ -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.8</version>
12
+ <version>9.0.9-canary-20251205-a1dedc6</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
+ 5f5fa04e964e8e75808277773f1b59c58856a968ee0f0e47e9889f97523d41a00a41429691e3dfd42809655018cf8d9fef5c2e0737b45e233fbbd9a86374f7ee
@@ -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.8</latest>
7
- <release>9.0.8</release>
6
+ <latest>9.0.9-canary-20251205-a1dedc6</latest>
7
+ <release>9.0.9-canary-20251205-a1dedc6</release>
8
8
  <versions>
9
- <version>9.0.8</version>
9
+ <version>9.0.9-canary-20251205-a1dedc6</version>
10
10
  </versions>
11
- <lastUpdated>20251205064543</lastUpdated>
11
+ <lastUpdated>20251205162210</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- bd852330656c1d8cd7577bf2ec09d77a
1
+ 2726636608552d171a28af32f1f8f124
@@ -1 +1 @@
1
- 1ee21799dbb4695e59e6f075827fa8ce8866ceb8
1
+ 626373036d4bfbaba7067505f132f0e761cd4385
@@ -1 +1 @@
1
- ccbbfa3bafab2d09d177ed104b2c2141e312537e2b8be56c8fb813e84b0de4ba
1
+ 55d342f6ab9e2c155aab85da0d00152a522914bd39033f3beabb194ac5fd31a3
@@ -1 +1 @@
1
- 5109559e848c2f93f9d6f5b70604da2c31336c1125b1f143e8172bf10a04fcdc3459364e81dc4eaafd9a5f884751c20314bf1814fc64b7f658d1a74779140bab
1
+ adc507d10c250ef2c4382976e777f0da715e20fa519fe25b650c5d2f6ddc71ee7fe4924c684a21c5de80974d5b2fa33f4d331094707f496769abe0a811f19c79
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-screen-orientation",
3
- "version": "9.0.8",
3
+ "version": "9.0.9-canary-20251205-a1dedc6",
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": "^5.0.8"
39
+ "expo-module-scripts": "5.1.0-canary-20251205-a1dedc6"
40
40
  },
41
41
  "peerDependencies": {
42
- "expo": "*",
42
+ "expo": "55.0.0-canary-20251205-a1dedc6",
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
- 36002dc6c73fec6d5bcec2a06b3e788b71776794b447c3b209f92c6cd1c2b09f
@@ -1 +0,0 @@
1
- 0762523e11c9f6feb1175437762753d91a77f273459b4028df9a4099bfaaa445c924b6d24a1956326a3f7a92681ac7083d75c993d0b2288e626d2ab9f8062373
@@ -1 +0,0 @@
1
- 3d37c343972b9dce6fb7b6135cb349e0c5e860a149e3f99a40c83beede152982
@@ -1 +0,0 @@
1
- 7c4101b209ec05a073392f808dca97e2bb06055cc3c1479dbd728fc3eb3b516c887218ab2677761f877eabe5c56d52f2197ff888a1fb60d712b00b54bac23f77