@capgo/capacitor-screen-orientation 7.0.0 → 8.1.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.
- package/CapgoCapacitorScreenOrientation.podspec +1 -1
- package/Package.swift +2 -2
- package/android/build.gradle +9 -9
- package/android/src/main/java/ee/forgr/capacitor/screenorientation/CapacitorScreenOrientationPlugin.java +1 -1
- package/dist/esm/web.js +1 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +1 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorScreenOrientationPlugin/CapacitorScreenOrientationPlugin.swift +1 -1
- package/package.json +15 -14
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapgoCapacitorScreenOrientation",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapgoCapacitorScreenOrientation",
|
|
10
10
|
targets: ["CapacitorScreenOrientationPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,18 +11,18 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
namespace "ee.forgr.capacitor.screenorientation"
|
|
22
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
21
|
+
namespace = "ee.forgr.capacitor.screenorientation"
|
|
22
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
23
23
|
defaultConfig {
|
|
24
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -34,7 +34,7 @@ android {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
lintOptions {
|
|
37
|
-
abortOnError false
|
|
37
|
+
abortOnError = false
|
|
38
38
|
}
|
|
39
39
|
compileOptions {
|
|
40
40
|
sourceCompatibility JavaVersion.VERSION_21
|
|
@@ -17,7 +17,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
17
17
|
@CapacitorPlugin(name = "CapacitorScreenOrientation")
|
|
18
18
|
public class CapacitorScreenOrientationPlugin extends Plugin implements SensorEventListener {
|
|
19
19
|
|
|
20
|
-
private final String pluginVersion = "
|
|
20
|
+
private final String pluginVersion = "8.1.1";
|
|
21
21
|
private int currentOrientation;
|
|
22
22
|
private SensorManager sensorManager;
|
|
23
23
|
private Sensor accelerometer;
|
package/dist/esm/web.js
CHANGED
|
@@ -47,6 +47,7 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
|
|
|
47
47
|
async startOrientationTracking(_options) {
|
|
48
48
|
// Motion-based orientation tracking is only supported on iOS
|
|
49
49
|
// Silently ignore on web
|
|
50
|
+
console.warn('Motion-based orientation tracking is not available on web platform', _options);
|
|
50
51
|
}
|
|
51
52
|
async stopOrientationTracking() {
|
|
52
53
|
// Motion-based orientation tracking is only supported on iOS
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["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AM,IAAI,CAAC,WAAW,EAAE,CAAC;QACnD,OAAO;YACL,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,iBAAiB,CAAC,IAAI;SACtC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAEO,kBAAkB,CAAC,IAAY;QACrC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACrE,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACzE,OAAO,oBAAoB,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,IAAI,KAAK,mBAAmB,EAAE,CAAC;YACvE,OAAO,mBAAmB,CAAC;QAC7B,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;YAC3E,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QACD,OAAO,kBAAkB,CAAC,CAAC,mBAAmB;IAChD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n CapacitorScreenOrientationPlugin,\n OrientationLockOptions,\n OrientationType,\n ScreenOrientationResult,\n StartOrientationTrackingOptions,\n} from './definitions';\n\nexport class CapacitorScreenOrientationWeb extends WebPlugin implements CapacitorScreenOrientationPlugin {\n private readonly pluginVersion = '1.0.0';\n\n constructor() {\n super();\n if (window.screen?.orientation) {\n window.screen.orientation.addEventListener('change', () => {\n this.notifyListeners('screenOrientationChange', {\n type: this.mapOrientationType(window.screen.orientation.type),\n });\n });\n }\n }\n\n async orientation(): Promise<ScreenOrientationResult> {\n if (!window.screen?.orientation) {\n throw this.unavailable('Screen Orientation API not available');\n }\n return {\n type: this.mapOrientationType(window.screen.orientation.type),\n };\n }\n\n async lock(options: OrientationLockOptions): Promise<void> {\n const screenOrientation = window.screen?.orientation as any;\n if (!screenOrientation?.lock) {\n throw this.unavailable('Screen Orientation lock not available');\n }\n\n // bypassOrientationLock is only supported on iOS native platform\n // Silently ignore it on web\n\n try {\n await screenOrientation.lock(options.orientation);\n } catch (error) {\n throw new Error(`Failed to lock orientation: ${error}`);\n }\n }\n\n async unlock(): Promise<void> {\n const screenOrientation = window.screen?.orientation as any;\n if (!screenOrientation?.unlock) {\n throw this.unavailable('Screen Orientation unlock not available');\n }\n screenOrientation.unlock();\n }\n\n async startOrientationTracking(_options?: StartOrientationTrackingOptions): Promise<void> {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n console.warn('Motion-based orientation tracking is not available on web platform', _options);\n }\n\n async stopOrientationTracking(): Promise<void> {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n\n async isOrientationLocked(): Promise<{\n locked: boolean;\n physicalOrientation?: OrientationType;\n uiOrientation: OrientationType;\n }> {\n const orientationResult = await this.orientation();\n return {\n locked: false,\n uiOrientation: orientationResult.type,\n };\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: this.pluginVersion };\n }\n\n private mapOrientationType(type: string): OrientationType {\n if (type.includes('portrait-primary') || type === 'portrait-primary') {\n return 'portrait-primary';\n }\n if (type.includes('portrait-secondary') || type === 'portrait-secondary') {\n return 'portrait-secondary';\n }\n if (type.includes('landscape-primary') || type === 'landscape-primary') {\n return 'landscape-primary';\n }\n if (type.includes('landscape-secondary') || type === 'landscape-secondary') {\n return 'landscape-secondary';\n }\n return 'portrait-primary'; // default fallback\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -54,6 +54,7 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
|
|
|
54
54
|
async startOrientationTracking(_options) {
|
|
55
55
|
// Motion-based orientation tracking is only supported on iOS
|
|
56
56
|
// Silently ignore on web
|
|
57
|
+
console.warn('Motion-based orientation tracking is not available on web platform', _options);
|
|
57
58
|
}
|
|
58
59
|
async stopOrientationTracking() {
|
|
59
60
|
// Motion-based orientation tracking is only supported on iOS
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ScreenOrientation = registerPlugin('CapacitorScreenOrientation', {\n web: () => import('./web').then((m) => new m.CapacitorScreenOrientationWeb()),\n});\nexport * from './definitions';\nexport { ScreenOrientation };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a;\n super();\n this.pluginVersion = '1.0.0';\n if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {\n window.screen.orientation.addEventListener('change', () => {\n this.notifyListeners('screenOrientationChange', {\n type: this.mapOrientationType(window.screen.orientation.type),\n });\n });\n }\n }\n async orientation() {\n var _a;\n if (!((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation)) {\n throw this.unavailable('Screen Orientation API not available');\n }\n return {\n type: this.mapOrientationType(window.screen.orientation.type),\n };\n }\n async lock(options) {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {\n throw this.unavailable('Screen Orientation lock not available');\n }\n // bypassOrientationLock is only supported on iOS native platform\n // Silently ignore it on web\n try {\n await screenOrientation.lock(options.orientation);\n }\n catch (error) {\n throw new Error(`Failed to lock orientation: ${error}`);\n }\n }\n async unlock() {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.unlock)) {\n throw this.unavailable('Screen Orientation unlock not available');\n }\n screenOrientation.unlock();\n }\n async startOrientationTracking(_options) {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async stopOrientationTracking() {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async isOrientationLocked() {\n const orientationResult = await this.orientation();\n return {\n locked: false,\n uiOrientation: orientationResult.type,\n };\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n mapOrientationType(type) {\n if (type.includes('portrait-primary') || type === 'portrait-primary') {\n return 'portrait-primary';\n }\n if (type.includes('portrait-secondary') || type === 'portrait-secondary') {\n return 'portrait-secondary';\n }\n if (type.includes('landscape-primary') || type === 'landscape-primary') {\n return 'landscape-primary';\n }\n if (type.includes('landscape-secondary') || type === 'landscape-secondary') {\n return 'landscape-secondary';\n }\n return 'portrait-primary'; // default fallback\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,4BAA4B,EAAE;AACvE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,6BAA6B,EAAE,CAAC;AACjF,CAAC;;ACFM,MAAM,6BAA6B,SAASC,cAAS,CAAC;AAC7D,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,EAAE;AACd,QAAQ,KAAK,EAAE;AACf,QAAQ,IAAI,CAAC,aAAa,GAAG,OAAO;AACpC,QAAQ,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,WAAW,EAAE;AACtF,YAAY,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM;AACvE,gBAAgB,IAAI,CAAC,eAAe,CAAC,yBAAyB,EAAE;AAChE,oBAAoB,IAAI,EAAE,IAAI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AmB,EAAE;AAChF,YAAY,OAAO,mBAAmB;AACtC,QAAQ;AACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,KAAK,qBAAqB,EAAE;AACpF,YAAY,OAAO,qBAAqB;AACxC,QAAQ;AACR,QAAQ,OAAO,kBAAkB,CAAC;AAClC,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ScreenOrientation = registerPlugin('CapacitorScreenOrientation', {\n web: () => import('./web').then((m) => new m.CapacitorScreenOrientationWeb()),\n});\nexport * from './definitions';\nexport { ScreenOrientation };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a;\n super();\n this.pluginVersion = '1.0.0';\n if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {\n window.screen.orientation.addEventListener('change', () => {\n this.notifyListeners('screenOrientationChange', {\n type: this.mapOrientationType(window.screen.orientation.type),\n });\n });\n }\n }\n async orientation() {\n var _a;\n if (!((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation)) {\n throw this.unavailable('Screen Orientation API not available');\n }\n return {\n type: this.mapOrientationType(window.screen.orientation.type),\n };\n }\n async lock(options) {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {\n throw this.unavailable('Screen Orientation lock not available');\n }\n // bypassOrientationLock is only supported on iOS native platform\n // Silently ignore it on web\n try {\n await screenOrientation.lock(options.orientation);\n }\n catch (error) {\n throw new Error(`Failed to lock orientation: ${error}`);\n }\n }\n async unlock() {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.unlock)) {\n throw this.unavailable('Screen Orientation unlock not available');\n }\n screenOrientation.unlock();\n }\n async startOrientationTracking(_options) {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n console.warn('Motion-based orientation tracking is not available on web platform', _options);\n }\n async stopOrientationTracking() {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async isOrientationLocked() {\n const orientationResult = await this.orientation();\n return {\n locked: false,\n uiOrientation: orientationResult.type,\n };\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n mapOrientationType(type) {\n if (type.includes('portrait-primary') || type === 'portrait-primary') {\n return 'portrait-primary';\n }\n if (type.includes('portrait-secondary') || type === 'portrait-secondary') {\n return 'portrait-secondary';\n }\n if (type.includes('landscape-primary') || type === 'landscape-primary') {\n return 'landscape-primary';\n }\n if (type.includes('landscape-secondary') || type === 'landscape-secondary') {\n return 'landscape-secondary';\n }\n return 'portrait-primary'; // default fallback\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,4BAA4B,EAAE;AACvE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,6BAA6B,EAAE,CAAC;AACjF,CAAC;;ACFM,MAAM,6BAA6B,SAASC,cAAS,CAAC;AAC7D,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,EAAE;AACd,QAAQ,KAAK,EAAE;AACf,QAAQ,IAAI,CAAC,aAAa,GAAG,OAAO;AACpC,QAAQ,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,WAAW,EAAE;AACtF,YAAY,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM;AACvE,gBAAgB,I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oBAAoB,EAAE;AAClF,YAAY,OAAO,oBAAoB;AACvC,QAAQ;AACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,IAAI,KAAK,mBAAmB,EAAE;AAChF,YAAY,OAAO,mBAAmB;AACtC,QAAQ;AACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,KAAK,qBAAqB,EAAE;AACpF,YAAY,OAAO,qBAAqB;AACxC,QAAQ;AACR,QAAQ,OAAO,kBAAkB,CAAC;AAClC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -53,6 +53,7 @@ var capacitorScreenOrientation = (function (exports, core) {
|
|
|
53
53
|
async startOrientationTracking(_options) {
|
|
54
54
|
// Motion-based orientation tracking is only supported on iOS
|
|
55
55
|
// Silently ignore on web
|
|
56
|
+
console.warn('Motion-based orientation tracking is not available on web platform', _options);
|
|
56
57
|
}
|
|
57
58
|
async stopOrientationTracking() {
|
|
58
59
|
// Motion-based orientation tracking is only supported on iOS
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ScreenOrientation = registerPlugin('CapacitorScreenOrientation', {\n web: () => import('./web').then((m) => new m.CapacitorScreenOrientationWeb()),\n});\nexport * from './definitions';\nexport { ScreenOrientation };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a;\n super();\n this.pluginVersion = '1.0.0';\n if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {\n window.screen.orientation.addEventListener('change', () => {\n this.notifyListeners('screenOrientationChange', {\n type: this.mapOrientationType(window.screen.orientation.type),\n });\n });\n }\n }\n async orientation() {\n var _a;\n if (!((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation)) {\n throw this.unavailable('Screen Orientation API not available');\n }\n return {\n type: this.mapOrientationType(window.screen.orientation.type),\n };\n }\n async lock(options) {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {\n throw this.unavailable('Screen Orientation lock not available');\n }\n // bypassOrientationLock is only supported on iOS native platform\n // Silently ignore it on web\n try {\n await screenOrientation.lock(options.orientation);\n }\n catch (error) {\n throw new Error(`Failed to lock orientation: ${error}`);\n }\n }\n async unlock() {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.unlock)) {\n throw this.unavailable('Screen Orientation unlock not available');\n }\n screenOrientation.unlock();\n }\n async startOrientationTracking(_options) {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async stopOrientationTracking() {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async isOrientationLocked() {\n const orientationResult = await this.orientation();\n return {\n locked: false,\n uiOrientation: orientationResult.type,\n };\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n mapOrientationType(type) {\n if (type.includes('portrait-primary') || type === 'portrait-primary') {\n return 'portrait-primary';\n }\n if (type.includes('portrait-secondary') || type === 'portrait-secondary') {\n return 'portrait-secondary';\n }\n if (type.includes('landscape-primary') || type === 'landscape-primary') {\n return 'landscape-primary';\n }\n if (type.includes('landscape-secondary') || type === 'landscape-secondary') {\n return 'landscape-secondary';\n }\n return 'portrait-primary'; // default fallback\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,4BAA4B,EAAE;IACvE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAA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,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;IAC9C,IAAI;IACJ,IAAI,kBAAkB,CAAC,IAAI,EAAE;IAC7B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,IAAI,KAAK,kBAAkB,EAAE;IAC9E,YAAY,OAAO,kBAAkB;IACrC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,IAAI,KAAK,oBAAoB,EAAE;IAClF,YAAY,OAAO,oBAAoB;IACvC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,IAAI,KAAK,mBAAmB,EAAE;IAChF,YAAY,OAAO,mBAAmB;IACtC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,KAAK,qBAAqB,EAAE;IACpF,YAAY,OAAO,qBAAqB;IACxC,QAAQ;IACR,QAAQ,OAAO,kBAAkB,CAAC;IAClC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ScreenOrientation = registerPlugin('CapacitorScreenOrientation', {\n web: () => import('./web').then((m) => new m.CapacitorScreenOrientationWeb()),\n});\nexport * from './definitions';\nexport { ScreenOrientation };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a;\n super();\n this.pluginVersion = '1.0.0';\n if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {\n window.screen.orientation.addEventListener('change', () => {\n this.notifyListeners('screenOrientationChange', {\n type: this.mapOrientationType(window.screen.orientation.type),\n });\n });\n }\n }\n async orientation() {\n var _a;\n if (!((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation)) {\n throw this.unavailable('Screen Orientation API not available');\n }\n return {\n type: this.mapOrientationType(window.screen.orientation.type),\n };\n }\n async lock(options) {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {\n throw this.unavailable('Screen Orientation lock not available');\n }\n // bypassOrientationLock is only supported on iOS native platform\n // Silently ignore it on web\n try {\n await screenOrientation.lock(options.orientation);\n }\n catch (error) {\n throw new Error(`Failed to lock orientation: ${error}`);\n }\n }\n async unlock() {\n var _a;\n const screenOrientation = (_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation;\n if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.unlock)) {\n throw this.unavailable('Screen Orientation unlock not available');\n }\n screenOrientation.unlock();\n }\n async startOrientationTracking(_options) {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n console.warn('Motion-based orientation tracking is not available on web platform', _options);\n }\n async stopOrientationTracking() {\n // Motion-based orientation tracking is only supported on iOS\n // Silently ignore on web\n }\n async isOrientationLocked() {\n const orientationResult = await this.orientation();\n return {\n locked: false,\n uiOrientation: orientationResult.type,\n };\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n mapOrientationType(type) {\n if (type.includes('portrait-primary') || type === 'portrait-primary') {\n return 'portrait-primary';\n }\n if (type.includes('portrait-secondary') || type === 'portrait-secondary') {\n return 'portrait-secondary';\n }\n if (type.includes('landscape-primary') || type === 'landscape-primary') {\n return 'landscape-primary';\n }\n if (type.includes('landscape-secondary') || type === 'landscape-secondary') {\n return 'landscape-secondary';\n }\n return 'portrait-primary'; // default fallback\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,iBAAiB,GAAGA,mBAAc,CAAC,4BAA4B,EAAE;IACvE,IAAI,G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,IAAI,CAAC,WAAW,EAAE;IAC1D,QAAQ,OAAO;IACf,YAAY,MAAM,EAAE,KAAK;IACzB,YAAY,aAAa,EAAE,iBAAiB,CAAC,IAAI;IACjD,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;IAC9C,IAAI;IACJ,IAAI,kBAAkB,CAAC,IAAI,EAAE;IAC7B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,IAAI,KAAK,kBAAkB,EAAE;IAC9E,YAAY,OAAO,kBAAkB;IACrC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,IAAI,KAAK,oBAAoB,EAAE;IAClF,YAAY,OAAO,oBAAoB;IACvC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,IAAI,KAAK,mBAAmB,EAAE;IAChF,YAAY,OAAO,mBAAmB;IACtC,QAAQ;IACR,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,IAAI,KAAK,qBAAqB,EAAE;IACpF,YAAY,OAAO,qBAAqB;IACxC,QAAQ;IACR,QAAQ,OAAO,kBAAkB,CAAC;IAClC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,7 @@ import UIKit
|
|
|
11
11
|
*/
|
|
12
12
|
@objc(CapacitorScreenOrientationPlugin)
|
|
13
13
|
public class CapacitorScreenOrientationPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
14
|
-
private let pluginVersion: String = "
|
|
14
|
+
private let pluginVersion: String = "8.1.1"
|
|
15
15
|
public let identifier = "CapacitorScreenOrientationPlugin"
|
|
16
16
|
public let jsName = "CapacitorScreenOrientation"
|
|
17
17
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-screen-orientation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"description": "Screen orientation plugin with support for bypassing orientation lock",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/Cap-go/capacitor-screen-orientation/issues"
|
|
26
26
|
},
|
|
27
|
+
"homepage": "https://capgo.app/docs/plugins/screen-orientation/",
|
|
27
28
|
"keywords": [
|
|
28
29
|
"capacitor",
|
|
29
30
|
"plugin",
|
|
@@ -54,27 +55,27 @@
|
|
|
54
55
|
"prepublishOnly": "npm run build"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@capacitor/android": "^
|
|
58
|
-
"@capacitor/cli": "^
|
|
59
|
-
"@capacitor/core": "^
|
|
60
|
-
"@capacitor/docgen": "^0.3.
|
|
61
|
-
"@capacitor/ios": "^
|
|
58
|
+
"@capacitor/android": "^8.0.0",
|
|
59
|
+
"@capacitor/cli": "^8.0.0",
|
|
60
|
+
"@capacitor/core": "^8.0.0",
|
|
61
|
+
"@capacitor/docgen": "^0.3.1",
|
|
62
|
+
"@capacitor/ios": "^8.0.0",
|
|
62
63
|
"@ionic/eslint-config": "^0.4.0",
|
|
63
64
|
"@ionic/prettier-config": "^4.0.0",
|
|
64
65
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"eslint": "^8.57.
|
|
66
|
+
"@types/node": "^24.10.1",
|
|
67
|
+
"eslint": "^8.57.1",
|
|
67
68
|
"eslint-plugin-import": "^2.31.0",
|
|
68
69
|
"husky": "^9.1.7",
|
|
69
|
-
"prettier": "^3.
|
|
70
|
-
"prettier-plugin-java": "^2.
|
|
71
|
-
"rimraf": "^6.0
|
|
72
|
-
"rollup": "^4.
|
|
70
|
+
"prettier": "^3.6.2",
|
|
71
|
+
"prettier-plugin-java": "^2.7.7",
|
|
72
|
+
"rimraf": "^6.1.0",
|
|
73
|
+
"rollup": "^4.53.2",
|
|
73
74
|
"swiftlint": "^2.0.0",
|
|
74
|
-
"typescript": "^5.
|
|
75
|
+
"typescript": "^5.9.3"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
|
-
"@capacitor/core": ">=
|
|
78
|
+
"@capacitor/core": ">=8.0.0"
|
|
78
79
|
},
|
|
79
80
|
"eslintConfig": {
|
|
80
81
|
"extends": "@ionic/eslint-config/recommended"
|