@symbiote-native/screen-orientation 0.0.1

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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +171 -0
  3. package/build/angular/index.d.ts +2 -0
  4. package/build/angular/index.js +4 -0
  5. package/build/angular/services/screen-orientation.service/index.d.ts +6 -0
  6. package/build/angular/services/screen-orientation.service/index.js +75 -0
  7. package/build/core/index.d.ts +3 -0
  8. package/build/core/index.js +2 -0
  9. package/build/core/native-module.d.ts +13 -0
  10. package/build/core/native-module.js +3 -0
  11. package/build/core/screen-orientation.d.ts +24 -0
  12. package/build/core/screen-orientation.js +152 -0
  13. package/build/core/types.d.ts +85 -0
  14. package/build/core/types.js +64 -0
  15. package/build/react/hooks/use-screen-orientation/index.d.ts +2 -0
  16. package/build/react/hooks/use-screen-orientation/index.js +20 -0
  17. package/build/react/index.d.ts +2 -0
  18. package/build/react/index.js +3 -0
  19. package/build/vue/composables/use-screen-orientation/index.d.ts +3 -0
  20. package/build/vue/composables/use-screen-orientation/index.js +27 -0
  21. package/build/vue/index.d.ts +2 -0
  22. package/build/vue/index.js +3 -0
  23. package/build-ngc/angular/index.d.ts +2 -0
  24. package/build-ngc/angular/index.js +5 -0
  25. package/build-ngc/angular/index.js.map +1 -0
  26. package/build-ngc/angular/services/screen-orientation.service/index.d.ts +9 -0
  27. package/build-ngc/angular/services/screen-orientation.service/index.js +34 -0
  28. package/build-ngc/angular/services/screen-orientation.service/index.js.map +1 -0
  29. package/build-ngc/core/index.d.ts +3 -0
  30. package/build-ngc/core/index.js +3 -0
  31. package/build-ngc/core/index.js.map +1 -0
  32. package/build-ngc/core/native-module.d.ts +13 -0
  33. package/build-ngc/core/native-module.js +4 -0
  34. package/build-ngc/core/native-module.js.map +1 -0
  35. package/build-ngc/core/screen-orientation.d.ts +24 -0
  36. package/build-ngc/core/screen-orientation.js +153 -0
  37. package/build-ngc/core/screen-orientation.js.map +1 -0
  38. package/build-ngc/core/types.d.ts +85 -0
  39. package/build-ngc/core/types.js +65 -0
  40. package/build-ngc/core/types.js.map +1 -0
  41. package/native-link.json +12 -0
  42. package/package.json +107 -0
  43. package/src/angular/index.ts +26 -0
  44. package/src/angular/services/screen-orientation.service/index.ts +45 -0
  45. package/src/angular/services/screen-orientation.service/screen-orientation.service.test.ts +101 -0
  46. package/src/core/index.ts +25 -0
  47. package/src/core/native-module.ts +36 -0
  48. package/src/core/screen-orientation.test.ts +307 -0
  49. package/src/core/screen-orientation.ts +186 -0
  50. package/src/core/types.ts +98 -0
  51. package/src/react/hooks/use-screen-orientation/index.ts +34 -0
  52. package/src/react/hooks/use-screen-orientation/use-screen-orientation.test.tsx +93 -0
  53. package/src/react/index.ts +26 -0
  54. package/src/vue/composables/use-screen-orientation/index.ts +42 -0
  55. package/src/vue/composables/use-screen-orientation/use-screen-orientation.test.ts +98 -0
  56. package/src/vue/index.ts +26 -0
@@ -0,0 +1,20 @@
1
+ // React lifecycle wiring over the framework-agnostic core (core/screen-orientation.ts). Seeds
2
+ // the initial value with one-shot getOrientationAsync()/getOrientationLockAsync() calls before
3
+ // the first native event fires, mirroring packages/network's useNetworkState.
4
+ import { useEffect, useState } from 'react';
5
+ import { addOrientationChangeListener, getOrientationAsync, getOrientationLockAsync, Orientation, OrientationLock, } from '../../../core';
6
+ export function useScreenOrientation() {
7
+ const [screenOrientation, setScreenOrientation] = useState({
8
+ orientation: Orientation.UNKNOWN,
9
+ orientationLock: OrientationLock.UNKNOWN,
10
+ });
11
+ useEffect(() => {
12
+ Promise.all([getOrientationAsync(), getOrientationLockAsync()]).then(([orientation, orientationLock]) => setScreenOrientation({ orientation, orientationLock }));
13
+ const subscription = addOrientationChangeListener(event => setScreenOrientation({
14
+ orientation: event.orientationInfo.orientation,
15
+ orientationLock: event.orientationLock,
16
+ }));
17
+ return () => subscription.remove();
18
+ }, []);
19
+ return screenOrientation;
20
+ }
@@ -0,0 +1,2 @@
1
+ export { useScreenOrientation } from './hooks/use-screen-orientation';
2
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, type PlatformOrientationInfo, type ScreenOrientationInfo, type OrientationChangeEvent, type OrientationChangeListener, type ScreenOrientationState, type EventSubscription, } from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/screen-orientation/react: the React entry over the framework-agnostic core.
2
+ export { useScreenOrientation } from './hooks/use-screen-orientation';
3
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, } from '../core';
@@ -0,0 +1,3 @@
1
+ import { type Ref } from '@vue/runtime-core';
2
+ import { type ScreenOrientationState } from '../../../core';
3
+ export declare function useScreenOrientation(): Ref<ScreenOrientationState>;
@@ -0,0 +1,27 @@
1
+ // Vue lifecycle wiring over the framework-agnostic core (core/screen-orientation.ts). Seeds the
2
+ // initial value with one-shot getOrientationAsync()/getOrientationLockAsync() calls before the
3
+ // first native event fires, mirroring packages/network's useNetworkState.
4
+ import { onMounted, onUnmounted, ref } from '@vue/runtime-core';
5
+ import { addOrientationChangeListener, getOrientationAsync, getOrientationLockAsync, Orientation, OrientationLock, } from '../../../core';
6
+ export function useScreenOrientation() {
7
+ const screenOrientation = ref({
8
+ orientation: Orientation.UNKNOWN,
9
+ orientationLock: OrientationLock.UNKNOWN,
10
+ });
11
+ let subscription;
12
+ onMounted(() => {
13
+ Promise.all([getOrientationAsync(), getOrientationLockAsync()]).then(([orientation, orientationLock]) => {
14
+ screenOrientation.value = { orientation, orientationLock };
15
+ });
16
+ subscription = addOrientationChangeListener(event => {
17
+ screenOrientation.value = {
18
+ orientation: event.orientationInfo.orientation,
19
+ orientationLock: event.orientationLock,
20
+ };
21
+ });
22
+ });
23
+ onUnmounted(() => {
24
+ subscription?.remove();
25
+ });
26
+ return screenOrientation;
27
+ }
@@ -0,0 +1,2 @@
1
+ export { useScreenOrientation } from './composables/use-screen-orientation';
2
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, type PlatformOrientationInfo, type ScreenOrientationInfo, type OrientationChangeEvent, type OrientationChangeListener, type ScreenOrientationState, type EventSubscription, } from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/screen-orientation/vue: the Vue entry over the framework-agnostic core.
2
+ export { useScreenOrientation } from './composables/use-screen-orientation';
3
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, } from '../core';
@@ -0,0 +1,2 @@
1
+ export { ScreenOrientationService } from './services/screen-orientation.service';
2
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, type PlatformOrientationInfo, type ScreenOrientationInfo, type OrientationChangeEvent, type OrientationChangeListener, type ScreenOrientationState, type EventSubscription, } from '../core';
@@ -0,0 +1,5 @@
1
+ // ScreenOrientationService is the Angular-only lifecycle half; the free functions and event
2
+ // subscription plumbing all live in core, shared with React/Vue.
3
+ export { ScreenOrientationService } from './services/screen-orientation.service';
4
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, } from '../core';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,iEAAiE;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,WAAW,EACX,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,GAOf,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type Signal } from '@angular/core';
2
+ import { type ScreenOrientationState } from '../../../core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ScreenOrientationService {
5
+ private readonly injector;
6
+ connect(): Signal<ScreenOrientationState>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScreenOrientationService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<ScreenOrientationService>;
9
+ }
@@ -0,0 +1,34 @@
1
+ import { effect, inject, Injectable, Injector, signal } from '@angular/core';
2
+ import { addOrientationChangeListener, getOrientationAsync, getOrientationLockAsync, Orientation, OrientationLock, } from '../../../core';
3
+ import * as i0 from "@angular/core";
4
+ // Angular twin of React's `useScreenOrientation` hook and Vue's `useScreenOrientation`
5
+ // composable.
6
+ //
7
+ // readonly screenOrientation = inject(ScreenOrientationService).connect();
8
+ // // template: {{ screenOrientation().orientation }}
9
+ export class ScreenOrientationService {
10
+ injector = inject(Injector);
11
+ connect() {
12
+ const screenOrientation = signal({
13
+ orientation: Orientation.UNKNOWN,
14
+ orientationLock: OrientationLock.UNKNOWN,
15
+ }, /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "screenOrientation" }] : /* istanbul ignore next */ []));
17
+ effect(onCleanup => {
18
+ Promise.all([getOrientationAsync(), getOrientationLockAsync()]).then(([orientation, orientationLock]) => screenOrientation.set({ orientation, orientationLock }));
19
+ const subscription = addOrientationChangeListener(event => screenOrientation.set({
20
+ orientation: event.orientationInfo.orientation,
21
+ orientationLock: event.orientationLock,
22
+ }));
23
+ onCleanup(() => subscription.remove());
24
+ }, { injector: this.injector });
25
+ return screenOrientation.asReadonly();
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScreenOrientationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
28
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScreenOrientationService, providedIn: 'root' });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ScreenOrientationService, decorators: [{
31
+ type: Injectable,
32
+ args: [{ providedIn: 'root' }]
33
+ }] });
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/angular/services/screen-orientation.service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,eAAe,GAEhB,MAAM,eAAe,CAAC;;AAEvB,uFAAuF;AACvF,cAAc;AACd,EAAE;AACF,6EAA6E;AAC7E,uDAAuD;AAEvD,MAAM,OAAO,wBAAwB;IAClB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE7C,OAAO;QACL,MAAM,iBAAiB,GAAG,MAAM,CAAyB;YACvD,WAAW,EAAE,WAAW,CAAC,OAAO;YAChC,eAAe,EAAE,eAAe,CAAC,OAAO;SACzC;8FAAC,CAAC;QAEH,MAAM,CACJ,SAAS,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC,IAAI,CAClE,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,EAAE,CACjC,iBAAiB,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAC1D,CAAC;YACF,MAAM,YAAY,GAAG,4BAA4B,CAAC,KAAK,CAAC,EAAE,CACxD,iBAAiB,CAAC,GAAG,CAAC;gBACpB,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,WAAW;gBAC9C,eAAe,EAAE,KAAK,CAAC,eAAe;aACvC,CAAC,CACH,CAAC;YACF,SAAS,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;QACzC,CAAC,EACD,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAC5B,CAAC;QAEF,OAAO,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;uGA3BU,wBAAwB;2GAAxB,wBAAwB,cADX,MAAM;;2FACnB,wBAAwB;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, } from './screen-orientation';
2
+ export { Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, type PlatformOrientationInfo, type ScreenOrientationInfo, type OrientationChangeEvent, type OrientationChangeListener, type ScreenOrientationState, } from './types';
3
+ export type { EventSubscription } from 'expo-modules-core';
@@ -0,0 +1,3 @@
1
+ export { lockAsync, lockPlatformAsync, unlockAsync, getOrientationAsync, getOrientationLockAsync, getPlatformOrientationLockAsync, supportsOrientationLockAsync, addOrientationChangeListener, removeOrientationChangeListeners, removeOrientationChangeListener, } from './screen-orientation';
2
+ export { Orientation, OrientationLock, SizeClassIOS, WebOrientationLock, WebOrientation, } from './types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,GAMf,MAAM,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { Orientation, OrientationChangeEvent, OrientationLock, WebOrientationLock } from './types';
3
+ export type IPlatformOrientationParam = number | Orientation[] | WebOrientationLock;
4
+ export type INativeScreenOrientationModule = {
5
+ lockAsync?(orientationLock: OrientationLock): Promise<void>;
6
+ lockPlatformAsync?(platformOrientationParam: IPlatformOrientationParam): Promise<void>;
7
+ getOrientationAsync?(): Promise<Orientation>;
8
+ getOrientationLockAsync?(): Promise<OrientationLock>;
9
+ getPlatformOrientationLockAsync?(): Promise<IPlatformOrientationParam>;
10
+ supportsOrientationLockAsync?(orientationLock: OrientationLock): Promise<boolean>;
11
+ addListener(eventName: 'expoDidUpdateDimensions', listener: (event: OrientationChangeEvent) => void): EventSubscription;
12
+ };
13
+ export declare const expoScreenOrientation: INativeScreenOrientationModule;
@@ -0,0 +1,4 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPO_SCREEN_ORIENTATION_MODULE_NAME = 'ExpoScreenOrientation';
3
+ export const expoScreenOrientation = requireNativeModule(EXPO_SCREEN_ORIENTATION_MODULE_NAME);
4
+ //# sourceMappingURL=native-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AASxD,MAAM,mCAAmC,GAAG,uBAAuB,CAAC;AAwBpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CACtD,mCAAmC,CACpC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type EventSubscription } from 'expo-modules-core';
2
+ import { Orientation, OrientationLock, type OrientationChangeListener, type PlatformOrientationInfo } from './types';
3
+ /** Locks the screen to the given orientation. */
4
+ export declare function lockAsync(orientationLock: OrientationLock): Promise<void>;
5
+ /** Locks the screen to a platform-specific orientation param — Android constant, iOS
6
+ * orientation array, or web `WebOrientationLock`. */
7
+ export declare function lockPlatformAsync(options: PlatformOrientationInfo): Promise<void>;
8
+ /** Unlocks the screen orientation back to the system default. */
9
+ export declare function unlockAsync(): Promise<void>;
10
+ /** Gets the device's current screen orientation. */
11
+ export declare function getOrientationAsync(): Promise<Orientation>;
12
+ /** Gets the current orientation lock, falling back to the last value set via `lockAsync()`/
13
+ * `lockPlatformAsync()` when the native method itself isn't available. */
14
+ export declare function getOrientationLockAsync(): Promise<OrientationLock>;
15
+ /** Gets the current orientation lock as a platform-specific value. */
16
+ export declare function getPlatformOrientationLockAsync(): Promise<PlatformOrientationInfo>;
17
+ /** Whether the given orientation lock is supported on this device. */
18
+ export declare function supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean>;
19
+ /** Subscribes to orientation-change events. */
20
+ export declare function addOrientationChangeListener(listener: OrientationChangeListener): EventSubscription;
21
+ /** Removes every orientation-change listener registered via `addOrientationChangeListener()`. */
22
+ export declare function removeOrientationChangeListeners(): void;
23
+ /** Removes a single orientation-change listener's subscription. */
24
+ export declare function removeOrientationChangeListener(subscription: EventSubscription): void;
@@ -0,0 +1,153 @@
1
+ // Hand-ported from .vendors/expo/packages/expo-screen-orientation/src/ScreenOrientation.ts
2
+ // (sdk-57). Unlike battery, upstream ScreenOrientation throws UnavailabilityError when the
3
+ // native method is absent — same convention as packages/network/src/core/network.ts.
4
+ import { Platform, UnavailabilityError } from 'expo-modules-core';
5
+ import { Dimensions } from 'react-native';
6
+ import { expoScreenOrientation } from './native-module';
7
+ import { Orientation, OrientationLock, WebOrientationLock, } from './types';
8
+ const NATIVE_MODULE_NAME = 'ScreenOrientation';
9
+ let _orientationChangeSubscribers = [];
10
+ let _lastOrientationLock = OrientationLock.UNKNOWN;
11
+ /** Locks the screen to the given orientation. */
12
+ export async function lockAsync(orientationLock) {
13
+ if (!expoScreenOrientation.lockAsync) {
14
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'lockAsync');
15
+ }
16
+ const orientationLocks = Object.values(OrientationLock);
17
+ if (!orientationLocks.includes(orientationLock)) {
18
+ throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);
19
+ }
20
+ if (orientationLock === OrientationLock.OTHER) {
21
+ return;
22
+ }
23
+ await expoScreenOrientation.lockAsync(orientationLock);
24
+ _lastOrientationLock = orientationLock;
25
+ }
26
+ /** Locks the screen to a platform-specific orientation param — Android constant, iOS
27
+ * orientation array, or web `WebOrientationLock`. */
28
+ export async function lockPlatformAsync(options) {
29
+ if (!expoScreenOrientation.lockPlatformAsync) {
30
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'lockPlatformAsync');
31
+ }
32
+ const { screenOrientationConstantAndroid, screenOrientationArrayIOS, screenOrientationLockWeb } = options;
33
+ let platformOrientationParam;
34
+ if (Platform.OS === 'android' && screenOrientationConstantAndroid) {
35
+ if (isNaN(screenOrientationConstantAndroid)) {
36
+ throw new TypeError(`lockPlatformAsync Android platform: screenOrientationConstantAndroid cannot be called with ${screenOrientationConstantAndroid}`);
37
+ }
38
+ platformOrientationParam = screenOrientationConstantAndroid;
39
+ }
40
+ else if (Platform.OS === 'ios' && screenOrientationArrayIOS) {
41
+ if (!Array.isArray(screenOrientationArrayIOS)) {
42
+ throw new TypeError(`lockPlatformAsync iOS platform: screenOrientationArrayIOS cannot be called with ${screenOrientationArrayIOS}`);
43
+ }
44
+ const orientations = Object.values(Orientation);
45
+ for (const orientation of screenOrientationArrayIOS) {
46
+ if (!orientations.includes(orientation)) {
47
+ throw new TypeError(`lockPlatformAsync iOS platform: ${orientation} is not a valid Orientation`);
48
+ }
49
+ }
50
+ platformOrientationParam = screenOrientationArrayIOS;
51
+ }
52
+ else if (Platform.OS === 'web' && screenOrientationLockWeb) {
53
+ const webOrientationLocks = Object.values(WebOrientationLock);
54
+ if (!webOrientationLocks.includes(screenOrientationLockWeb)) {
55
+ throw new TypeError(`Invalid Web Orientation Lock: ${screenOrientationLockWeb}`);
56
+ }
57
+ platformOrientationParam = screenOrientationLockWeb;
58
+ }
59
+ if (!platformOrientationParam) {
60
+ throw new TypeError('lockPlatformAsync cannot be called with undefined option properties');
61
+ }
62
+ await expoScreenOrientation.lockPlatformAsync(platformOrientationParam);
63
+ _lastOrientationLock = OrientationLock.OTHER;
64
+ }
65
+ /** Unlocks the screen orientation back to the system default. */
66
+ export async function unlockAsync() {
67
+ if (!expoScreenOrientation.lockAsync) {
68
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'lockAsync');
69
+ }
70
+ await expoScreenOrientation.lockAsync(OrientationLock.DEFAULT);
71
+ }
72
+ /** Gets the device's current screen orientation. */
73
+ export async function getOrientationAsync() {
74
+ if (!expoScreenOrientation.getOrientationAsync) {
75
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getOrientationAsync');
76
+ }
77
+ return expoScreenOrientation.getOrientationAsync();
78
+ }
79
+ /** Gets the current orientation lock, falling back to the last value set via `lockAsync()`/
80
+ * `lockPlatformAsync()` when the native method itself isn't available. */
81
+ export async function getOrientationLockAsync() {
82
+ if (!expoScreenOrientation.getOrientationLockAsync) {
83
+ return _lastOrientationLock;
84
+ }
85
+ return expoScreenOrientation.getOrientationLockAsync();
86
+ }
87
+ /** Gets the current orientation lock as a platform-specific value. */
88
+ export async function getPlatformOrientationLockAsync() {
89
+ const platformOrientationLock = await expoScreenOrientation.getPlatformOrientationLockAsync?.();
90
+ if (Platform.OS === 'android' && typeof platformOrientationLock === 'number') {
91
+ return { screenOrientationConstantAndroid: platformOrientationLock };
92
+ }
93
+ if (Platform.OS === 'ios' && Array.isArray(platformOrientationLock)) {
94
+ return { screenOrientationArrayIOS: platformOrientationLock };
95
+ }
96
+ if (Platform.OS === 'web' && typeof platformOrientationLock === 'string') {
97
+ return { screenOrientationLockWeb: platformOrientationLock };
98
+ }
99
+ return {};
100
+ }
101
+ /** Whether the given orientation lock is supported on this device. */
102
+ export async function supportsOrientationLockAsync(orientationLock) {
103
+ if (!expoScreenOrientation.supportsOrientationLockAsync) {
104
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'supportsOrientationLockAsync');
105
+ }
106
+ const orientationLocks = Object.values(OrientationLock);
107
+ if (!orientationLocks.includes(orientationLock)) {
108
+ throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);
109
+ }
110
+ return expoScreenOrientation.supportsOrientationLockAsync(orientationLock);
111
+ }
112
+ /** Subscribes to orientation-change events. */
113
+ export function addOrientationChangeListener(listener) {
114
+ if (typeof listener !== 'function') {
115
+ throw new TypeError(`addOrientationChangeListener cannot be called with ${listener}`);
116
+ }
117
+ const subscription = createDidUpdateDimensionsSubscription(listener);
118
+ _orientationChangeSubscribers.push(subscription);
119
+ return subscription;
120
+ }
121
+ /** Removes every orientation-change listener registered via `addOrientationChangeListener()`. */
122
+ export function removeOrientationChangeListeners() {
123
+ let i = _orientationChangeSubscribers.length;
124
+ while (i--) {
125
+ _orientationChangeSubscribers[i]?.remove();
126
+ _orientationChangeSubscribers.pop();
127
+ }
128
+ }
129
+ /** Removes a single orientation-change listener's subscription. */
130
+ export function removeOrientationChangeListener(subscription) {
131
+ if (!subscription || !subscription.remove) {
132
+ throw new TypeError('Must pass in a valid subscription');
133
+ }
134
+ subscription.remove();
135
+ _orientationChangeSubscribers = _orientationChangeSubscribers.filter(sub => sub !== subscription);
136
+ }
137
+ // IMPORTANT: Android doesn't emit `expoDidUpdateDimensions` — RN's own Dimensions module does,
138
+ // so on Android we piggyback on RN's own `Dimensions.addEventListener('change', ...)` instead.
139
+ function createDidUpdateDimensionsSubscription(listener) {
140
+ if (Platform.OS === 'web' || Platform.OS === 'ios') {
141
+ return expoScreenOrientation.addListener('expoDidUpdateDimensions', async (update) => {
142
+ listener(update);
143
+ });
144
+ }
145
+ return Dimensions.addEventListener('change', async () => {
146
+ const [orientationLock, orientation] = await Promise.all([
147
+ getOrientationLockAsync(),
148
+ getOrientationAsync(),
149
+ ]);
150
+ listener({ orientationInfo: { orientation }, orientationLock });
151
+ });
152
+ }
153
+ //# sourceMappingURL=screen-orientation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen-orientation.js","sourceRoot":"","sources":["../../src/core/screen-orientation.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,2FAA2F;AAC3F,qFAAqF;AACrF,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAA0B,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAkC,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,GAInB,MAAM,SAAS,CAAC;AAEjB,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C,IAAI,6BAA6B,GAAwB,EAAE,CAAC;AAC5D,IAAI,oBAAoB,GAAoB,eAAe,CAAC,OAAO,CAAC;AAEpE,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,SAAS,C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AAC/F,SAAS,qCAAqC,CAC5C,QAAmC;IAEnC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QACnD,OAAO,qBAAqB,CAAC,WAAW,CACtC,yBAAyB,EACzB,KAAK,EAAE,MAA8B,EAAE,EAAE;YACvC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC,CACF,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACvD,uBAAuB,EAAE;YACzB,mBAAmB,EAAE;SACtB,CAAC,CAAC;QACH,QAAQ,CAAC,EAAE,eAAe,EAAE,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,85 @@
1
+ export declare enum Orientation {
2
+ UNKNOWN = 0,
3
+ PORTRAIT_UP = 1,
4
+ PORTRAIT_DOWN = 2,
5
+ LANDSCAPE_LEFT = 3,
6
+ LANDSCAPE_RIGHT = 4
7
+ }
8
+ /**
9
+ * Values that can be passed to `lockAsync()`. `ALL`/`PORTRAIT` are invalid on devices that
10
+ * don't support `PORTRAIT_DOWN`.
11
+ */
12
+ export declare enum OrientationLock {
13
+ /** iOS: all orientations except `PORTRAIT_DOWN`. Android: system decides. */
14
+ DEFAULT = 0,
15
+ /** All four possible orientations. */
16
+ ALL = 1,
17
+ /** Any portrait orientation. */
18
+ PORTRAIT = 2,
19
+ /** Right-side-up portrait only. */
20
+ PORTRAIT_UP = 3,
21
+ /** Upside-down portrait only. */
22
+ PORTRAIT_DOWN = 4,
23
+ /** Any landscape orientation. */
24
+ LANDSCAPE = 5,
25
+ /** Left landscape only. */
26
+ LANDSCAPE_LEFT = 6,
27
+ /** Right landscape only. */
28
+ LANDSCAPE_RIGHT = 7,
29
+ /** A platform-specific orientation — not a valid `lockAsync()` policy. */
30
+ OTHER = 8,
31
+ /** Unknown lock — not a valid `lockAsync()` policy. */
32
+ UNKNOWN = 9
33
+ }
34
+ /** Each iOS device has a default set of UIKit size classes. */
35
+ export declare enum SizeClassIOS {
36
+ UNKNOWN = 0,
37
+ COMPACT = 1,
38
+ REGULAR = 2
39
+ }
40
+ export declare enum WebOrientationLock {
41
+ PORTRAIT_PRIMARY = "portrait-primary",
42
+ PORTRAIT_SECONDARY = "portrait-secondary",
43
+ PORTRAIT = "portrait",
44
+ LANDSCAPE_PRIMARY = "landscape-primary",
45
+ LANDSCAPE_SECONDARY = "landscape-secondary",
46
+ LANDSCAPE = "landscape",
47
+ ANY = "any",
48
+ NATURAL = "natural",
49
+ UNKNOWN = "unknown"
50
+ }
51
+ export declare enum WebOrientation {
52
+ PORTRAIT_PRIMARY = "portrait-primary",
53
+ PORTRAIT_SECONDARY = "portrait-secondary",
54
+ LANDSCAPE_PRIMARY = "landscape-primary",
55
+ LANDSCAPE_SECONDARY = "landscape-secondary"
56
+ }
57
+ export type PlatformOrientationInfo = {
58
+ /** @platform android */
59
+ screenOrientationConstantAndroid?: number;
60
+ /** @platform ios */
61
+ screenOrientationArrayIOS?: Orientation[];
62
+ /** @platform web */
63
+ screenOrientationLockWeb?: WebOrientationLock;
64
+ };
65
+ export type ScreenOrientationInfo = {
66
+ orientation: Orientation;
67
+ /** @platform ios */
68
+ verticalSizeClass?: SizeClassIOS;
69
+ /** @platform ios */
70
+ horizontalSizeClass?: SizeClassIOS;
71
+ };
72
+ export type OrientationChangeEvent = {
73
+ orientationLock: OrientationLock;
74
+ orientationInfo: ScreenOrientationInfo;
75
+ };
76
+ export type OrientationChangeListener = (event: OrientationChangeEvent) => void;
77
+ /**
78
+ * The shape shared by every adapter's `useScreenOrientation()` hook/composable/service — not an
79
+ * upstream expo-screen-orientation type (upstream ships no reactive hook of its own), defined once
80
+ * here so React/Vue/Angular all consume the identical shape instead of three ad-hoc declarations.
81
+ */
82
+ export type ScreenOrientationState = {
83
+ orientation: Orientation;
84
+ orientationLock: OrientationLock;
85
+ };
@@ -0,0 +1,65 @@
1
+ // Hand-ported from .vendors/expo/packages/expo-screen-orientation/src/ScreenOrientation.types.ts
2
+ // (sdk-57) — plain enums/data shapes, no `expo` meta-package import to swap out (same as
3
+ // packages/network's types.ts).
4
+ export var Orientation;
5
+ (function (Orientation) {
6
+ Orientation[Orientation["UNKNOWN"] = 0] = "UNKNOWN";
7
+ Orientation[Orientation["PORTRAIT_UP"] = 1] = "PORTRAIT_UP";
8
+ Orientation[Orientation["PORTRAIT_DOWN"] = 2] = "PORTRAIT_DOWN";
9
+ Orientation[Orientation["LANDSCAPE_LEFT"] = 3] = "LANDSCAPE_LEFT";
10
+ Orientation[Orientation["LANDSCAPE_RIGHT"] = 4] = "LANDSCAPE_RIGHT";
11
+ })(Orientation || (Orientation = {}));
12
+ /**
13
+ * Values that can be passed to `lockAsync()`. `ALL`/`PORTRAIT` are invalid on devices that
14
+ * don't support `PORTRAIT_DOWN`.
15
+ */
16
+ export var OrientationLock;
17
+ (function (OrientationLock) {
18
+ /** iOS: all orientations except `PORTRAIT_DOWN`. Android: system decides. */
19
+ OrientationLock[OrientationLock["DEFAULT"] = 0] = "DEFAULT";
20
+ /** All four possible orientations. */
21
+ OrientationLock[OrientationLock["ALL"] = 1] = "ALL";
22
+ /** Any portrait orientation. */
23
+ OrientationLock[OrientationLock["PORTRAIT"] = 2] = "PORTRAIT";
24
+ /** Right-side-up portrait only. */
25
+ OrientationLock[OrientationLock["PORTRAIT_UP"] = 3] = "PORTRAIT_UP";
26
+ /** Upside-down portrait only. */
27
+ OrientationLock[OrientationLock["PORTRAIT_DOWN"] = 4] = "PORTRAIT_DOWN";
28
+ /** Any landscape orientation. */
29
+ OrientationLock[OrientationLock["LANDSCAPE"] = 5] = "LANDSCAPE";
30
+ /** Left landscape only. */
31
+ OrientationLock[OrientationLock["LANDSCAPE_LEFT"] = 6] = "LANDSCAPE_LEFT";
32
+ /** Right landscape only. */
33
+ OrientationLock[OrientationLock["LANDSCAPE_RIGHT"] = 7] = "LANDSCAPE_RIGHT";
34
+ /** A platform-specific orientation — not a valid `lockAsync()` policy. */
35
+ OrientationLock[OrientationLock["OTHER"] = 8] = "OTHER";
36
+ /** Unknown lock — not a valid `lockAsync()` policy. */
37
+ OrientationLock[OrientationLock["UNKNOWN"] = 9] = "UNKNOWN";
38
+ })(OrientationLock || (OrientationLock = {}));
39
+ /** Each iOS device has a default set of UIKit size classes. */
40
+ export var SizeClassIOS;
41
+ (function (SizeClassIOS) {
42
+ SizeClassIOS[SizeClassIOS["UNKNOWN"] = 0] = "UNKNOWN";
43
+ SizeClassIOS[SizeClassIOS["COMPACT"] = 1] = "COMPACT";
44
+ SizeClassIOS[SizeClassIOS["REGULAR"] = 2] = "REGULAR";
45
+ })(SizeClassIOS || (SizeClassIOS = {}));
46
+ export var WebOrientationLock;
47
+ (function (WebOrientationLock) {
48
+ WebOrientationLock["PORTRAIT_PRIMARY"] = "portrait-primary";
49
+ WebOrientationLock["PORTRAIT_SECONDARY"] = "portrait-secondary";
50
+ WebOrientationLock["PORTRAIT"] = "portrait";
51
+ WebOrientationLock["LANDSCAPE_PRIMARY"] = "landscape-primary";
52
+ WebOrientationLock["LANDSCAPE_SECONDARY"] = "landscape-secondary";
53
+ WebOrientationLock["LANDSCAPE"] = "landscape";
54
+ WebOrientationLock["ANY"] = "any";
55
+ WebOrientationLock["NATURAL"] = "natural";
56
+ WebOrientationLock["UNKNOWN"] = "unknown";
57
+ })(WebOrientationLock || (WebOrientationLock = {}));
58
+ export var WebOrientation;
59
+ (function (WebOrientation) {
60
+ WebOrientation["PORTRAIT_PRIMARY"] = "portrait-primary";
61
+ WebOrientation["PORTRAIT_SECONDARY"] = "portrait-secondary";
62
+ WebOrientation["LANDSCAPE_PRIMARY"] = "landscape-primary";
63
+ WebOrientation["LANDSCAPE_SECONDARY"] = "landscape-secondary";
64
+ })(WebOrientation || (WebOrientation = {}));
65
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,yFAAyF;AACzF,gCAAgC;AAEhC,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,+DAAiB,CAAA;IACjB,iEAAkB,CAAA;IAClB,mEAAmB,CAAA;AACrB,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAqBX;AArBD,WAAY,eAAe;IACzB,6EAA6E;IAC7E,2DAAW,CAAA;IACX,sCAAsC;IACtC,mDAAO,CAAA;IACP,gCAAgC;IAChC,6DAAY,CAAA;IACZ,mCAAmC;IACnC,mEAAe,CAAA;IACf,iCAAiC;IACjC,uEAAiB,CAAA;IACjB,iCAAiC;IACjC,+DAAa,CAAA;IACb,2BAA2B;IAC3B,yEAAkB,CAAA;IAClB,4BAA4B;IAC5B,2EAAmB,CAAA;IACnB,0EAA0E;IAC1E,uDAAS,CAAA;IACT,uDAAuD;IACvD,2DAAW,CAAA;AACb,CAAC,EArBW,eAAe,KAAf,eAAe,QAqB1B;AAED,+DAA+D;AAC/D,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,qDAAW,CAAA;IACX,qDAAW,CAAA;AACb,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,2DAAqC,CAAA;IACrC,+DAAyC,CAAA;IACzC,2CAAqB,CAAA;IACrB,6DAAuC,CAAA;IACvC,iEAA2C,CAAA;IAC3C,6CAAuB,CAAA;IACvB,iCAAW,CAAA;IACX,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;AACrB,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B;AAED,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,uDAAqC,CAAA;IACrC,2DAAyC,CAAA;IACzC,yDAAuC,CAAA;IACvC,6DAA2C,CAAA;AAC7C,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"}
@@ -0,0 +1,12 @@
1
+ {
2
+ "android": {
3
+ "gradleProjectName": "expo-screen-orientation",
4
+ "modules": [
5
+ {
6
+ "importPath": "expo.modules.screenorientation.ScreenOrientationModule",
7
+ "className": "ScreenOrientationModule",
8
+ "nativeName": "ExpoScreenOrientation"
9
+ }
10
+ ]
11
+ }
12
+ }