@capgo/capacitor-screen-orientation 8.3.1 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/web.js CHANGED
@@ -1,44 +1,31 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- const FLAT_FOLD = { state: 'flat', isSeparating: false, posture: 'flat' };
3
- export function sizeClassOf(width, height) {
4
- const widthClass = width >= 1600
5
- ? 'extraLarge'
6
- : width >= 1200
7
- ? 'large'
8
- : width >= 840
9
- ? 'expanded'
10
- : width >= 600
11
- ? 'medium'
12
- : 'compact';
13
- const heightClass = height >= 900 ? 'expanded' : height >= 480 ? 'medium' : 'compact';
14
- return {
15
- horizontal: width >= 600 ? 'regular' : 'compact',
16
- vertical: height >= 480 ? 'regular' : 'compact',
17
- widthClass,
18
- heightClass,
19
- };
20
- }
2
+ import { sizeClassOf } from './size-class';
3
+ import { foldStateKey, readWebFoldState, webDeviceFoldable } from './web-fold';
4
+ export { sizeClassOf } from './size-class';
21
5
  export class CapacitorScreenOrientationWeb extends WebPlugin {
22
6
  constructor() {
23
- var _a;
7
+ var _a, _b;
24
8
  super();
25
9
  this.pluginVersion = '1.0.0';
10
+ this.lastFoldKey = null;
26
11
  this.lastSizeClass = null;
27
12
  if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {
28
13
  window.screen.orientation.addEventListener('change', () => {
29
14
  this.notifyListeners('screenOrientationChange', {
30
15
  type: this.mapOrientationType(window.screen.orientation.type),
31
16
  });
17
+ this.notifyFoldIfChanged();
32
18
  });
33
19
  }
34
20
  window.addEventListener('resize', () => {
35
- const next = this.readSizeClass();
36
- const previous = JSON.stringify(this.lastSizeClass);
37
- if (previous === JSON.stringify(next))
38
- return;
39
- this.lastSizeClass = next;
40
- this.notifyListeners('sizeClassChange', next);
21
+ this.notifySizeClassIfChanged();
22
+ this.notifyFoldIfChanged();
23
+ });
24
+ (_b = navigator.devicePosture) === null || _b === void 0 ? void 0 : _b.addEventListener('change', () => {
25
+ this.notifyFoldIfChanged();
41
26
  });
27
+ this.lastSizeClass = this.readSizeClass();
28
+ this.lastFoldKey = foldStateKey(readWebFoldState(window.innerWidth, window.innerHeight));
42
29
  }
43
30
  async orientation() {
44
31
  var _a;
@@ -55,8 +42,6 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
55
42
  if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {
56
43
  throw this.unavailable('Screen Orientation lock not available');
57
44
  }
58
- // bypassOrientationLock is only supported on iOS native platform
59
- // Silently ignore it on web
60
45
  try {
61
46
  await screenOrientation.lock(options.orientation);
62
47
  }
@@ -73,13 +58,10 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
73
58
  screenOrientation.unlock();
74
59
  }
75
60
  async startOrientationTracking(_options) {
76
- // Motion-based orientation tracking is only supported on iOS
77
- // Silently ignore on web
78
61
  console.warn('Motion-based orientation tracking is not available on web platform', _options);
79
62
  }
80
63
  async stopOrientationTracking() {
81
- // Motion-based orientation tracking is only supported on iOS
82
- // Silently ignore on web
64
+ // No-op on web
83
65
  }
84
66
  async isOrientationLocked() {
85
67
  const orientationResult = await this.orientation();
@@ -89,10 +71,10 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
89
71
  };
90
72
  }
91
73
  async isDeviceFoldable() {
92
- return { foldable: false, supportsTabletop: false };
74
+ return webDeviceFoldable();
93
75
  }
94
76
  async getFoldState() {
95
- return FLAT_FOLD;
77
+ return readWebFoldState(window.innerWidth, window.innerHeight);
96
78
  }
97
79
  async getHingeAngle() {
98
80
  return { angle: null, status: null };
@@ -115,6 +97,23 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
115
97
  readSizeClass() {
116
98
  return sizeClassOf(window.innerWidth, window.innerHeight);
117
99
  }
100
+ notifySizeClassIfChanged() {
101
+ const next = this.readSizeClass();
102
+ const previous = JSON.stringify(this.lastSizeClass);
103
+ if (previous === JSON.stringify(next))
104
+ return;
105
+ this.lastSizeClass = next;
106
+ this.notifyListeners('sizeClassChange', next);
107
+ }
108
+ notifyFoldIfChanged() {
109
+ const next = readWebFoldState(window.innerWidth, window.innerHeight);
110
+ const key = foldStateKey(next);
111
+ if (key === this.lastFoldKey) {
112
+ return;
113
+ }
114
+ this.lastFoldKey = key;
115
+ this.notifyListeners('foldStateChange', next);
116
+ }
118
117
  mapOrientationType(type) {
119
118
  if (type.includes('portrait-primary') || type === 'portrait-primary') {
120
119
  return 'portrait-primary';
@@ -128,7 +127,7 @@ export class CapacitorScreenOrientationWeb extends WebPlugin {
128
127
  if (type.includes('landscape-secondary') || type === 'landscape-secondary') {
129
128
  return 'landscape-secondary';
130
129
  }
131
- return 'portrait-primary'; // default fallback
130
+ return 'portrait-primary';
132
131
  }
133
132
  }
134
133
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAgB5C,MAAM,SAAS,GAAc,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAErF,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,MAAc;IACvD,MAAM,UAAU,GACd,KAAK,IAAI,IAAI;QACX,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,KAAK,IAAI,IAAI;YACb,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,KAAK,IAAI,GAAG;gBACZ,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,KAAK,IAAI,GAAG;oBACZ,CAAC,CAAC,QAAQ;oBACV,CAAC,CAAC,SAAS,CAAC;IACtB,MAAM,WAAW,GAAG,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,S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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 BarPlacement,\n CapacitorScreenOrientationPlugin,\n DeviceFoldableResult,\n FoldState,\n HingeAngleResult,\n ReservedRegion,\n OrientationLockOptions,\n OrientationType,\n ScreenOrientationResult,\n SizeClass,\n StartOrientationTrackingOptions,\n} from './definitions';\n\nconst FLAT_FOLD: FoldState = { state: 'flat', isSeparating: false, posture: 'flat' };\n\nexport function sizeClassOf(width: number, height: number): SizeClass {\n const widthClass =\n width >= 1600\n ? 'extraLarge'\n : width >= 1200\n ? 'large'\n : width >= 840\n ? 'expanded'\n : width >= 600\n ? 'medium'\n : 'compact';\n const heightClass = height >= 900 ? 'expanded' : height >= 480 ? 'medium' : 'compact';\n return {\n horizontal: width >= 600 ? 'regular' : 'compact',\n vertical: height >= 480 ? 'regular' : 'compact',\n widthClass,\n heightClass,\n };\n}\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 window.addEventListener('resize', () => {\n const next = this.readSizeClass();\n const previous = JSON.stringify(this.lastSizeClass);\n if (previous === JSON.stringify(next)) return;\n this.lastSizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n });\n }\n\n private lastSizeClass: SizeClass | null = null;\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 isDeviceFoldable(): Promise<DeviceFoldableResult> {\n return { foldable: false, supportsTabletop: false };\n }\n\n async getFoldState(): Promise<FoldState> {\n return FLAT_FOLD;\n }\n\n async getHingeAngle(): Promise<HingeAngleResult> {\n return { angle: null, status: null };\n }\n\n async getReservedRegions(): Promise<{ regions: ReservedRegion[] }> {\n return { regions: [] };\n }\n\n async getBarPlacement(): Promise<BarPlacement> {\n return { verticalBarEdge: null, inset: 0 };\n }\n\n async setVerticalBarBehavior(): Promise<{ applied: boolean }> {\n return { applied: false };\n }\n\n async getSizeClass(): Promise<SizeClass> {\n return this.readSizeClass();\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: this.pluginVersion };\n }\n\n private readSizeClass(): SizeClass {\n return sizeClassOf(window.innerWidth, window.innerHeight);\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"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,6BAA8B,SAAQ,SAAS;IAI1D;;QACE,KAAK,EAAE,CAAC;QAJO,kBAAa,GAAG,OAAO,CAAC;QACjC,gBAAW,GAAkB,IAAI,CAAC;QAuBlC,kBAAa,GAAqB,IAAI,CAAC;QAnB7C,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,WAAW,EAAE,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;gBACxD,IAAI,CAAC,eAAe,CAAC,yBAAyB,EAAE;oBAC9C,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;iBAC9D,CAAC,CAAC;gBACH,IAAI,CAAC,mBAAmB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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;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n BarPlacement,\n CapacitorScreenOrientationPlugin,\n DeviceFoldableResult,\n FoldState,\n HingeAngleResult,\n ReservedRegion,\n OrientationLockOptions,\n OrientationType,\n ScreenOrientationResult,\n SizeClass,\n StartOrientationTrackingOptions,\n} from './definitions';\nimport { sizeClassOf } from './size-class';\nimport { foldStateKey, readWebFoldState, webDeviceFoldable } from './web-fold';\n\nexport { sizeClassOf } from './size-class';\n\nexport class CapacitorScreenOrientationWeb extends WebPlugin implements CapacitorScreenOrientationPlugin {\n private readonly pluginVersion = '1.0.0';\n private lastFoldKey: string | null = null;\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 this.notifyFoldIfChanged();\n });\n }\n window.addEventListener('resize', () => {\n this.notifySizeClassIfChanged();\n this.notifyFoldIfChanged();\n });\n navigator.devicePosture?.addEventListener('change', () => {\n this.notifyFoldIfChanged();\n });\n this.lastSizeClass = this.readSizeClass();\n this.lastFoldKey = foldStateKey(readWebFoldState(window.innerWidth, window.innerHeight));\n }\n\n private lastSizeClass: SizeClass | null = null;\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 { lock?: (orientation: string) => Promise<void> };\n if (!screenOrientation?.lock) {\n throw this.unavailable('Screen Orientation lock not available');\n }\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 { unlock?: () => void };\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 console.warn('Motion-based orientation tracking is not available on web platform', _options);\n }\n\n async stopOrientationTracking(): Promise<void> {\n // No-op 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 isDeviceFoldable(): Promise<DeviceFoldableResult> {\n return webDeviceFoldable();\n }\n\n async getFoldState(): Promise<FoldState> {\n return readWebFoldState(window.innerWidth, window.innerHeight);\n }\n\n async getHingeAngle(): Promise<HingeAngleResult> {\n return { angle: null, status: null };\n }\n\n async getReservedRegions(): Promise<{ regions: ReservedRegion[] }> {\n return { regions: [] };\n }\n\n async getBarPlacement(): Promise<BarPlacement> {\n return { verticalBarEdge: null, inset: 0 };\n }\n\n async setVerticalBarBehavior(): Promise<{ applied: boolean }> {\n return { applied: false };\n }\n\n async getSizeClass(): Promise<SizeClass> {\n return this.readSizeClass();\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: this.pluginVersion };\n }\n\n private readSizeClass(): SizeClass {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n\n private notifySizeClassIfChanged(): void {\n const next = this.readSizeClass();\n const previous = JSON.stringify(this.lastSizeClass);\n if (previous === JSON.stringify(next)) return;\n this.lastSizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n }\n\n private notifyFoldIfChanged(): void {\n const next = readWebFoldState(window.innerWidth, window.innerHeight);\n const key = foldStateKey(next);\n if (key === this.lastFoldKey) {\n return;\n }\n this.lastFoldKey = key;\n this.notifyListeners('foldStateChange', next);\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';\n }\n}\n"]}
@@ -6,46 +6,191 @@ const ScreenOrientation = core.registerPlugin('CapacitorScreenOrientation', {
6
6
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorScreenOrientationWeb()),
7
7
  });
8
8
 
9
- const FLAT_FOLD = { state: 'flat', isSeparating: false, posture: 'flat' };
9
+ const MEDIUM_WIDTH = 600;
10
+ const EXPANDED_WIDTH = 840;
11
+ const LARGE_WIDTH = 1200;
12
+ const EXTRA_LARGE_WIDTH = 1600;
13
+ const MEDIUM_HEIGHT = 480;
14
+ const EXPANDED_HEIGHT = 900;
15
+ function widthClassOf(width) {
16
+ if (width >= EXTRA_LARGE_WIDTH)
17
+ return 'extraLarge';
18
+ if (width >= LARGE_WIDTH)
19
+ return 'large';
20
+ if (width >= EXPANDED_WIDTH)
21
+ return 'expanded';
22
+ if (width >= MEDIUM_WIDTH)
23
+ return 'medium';
24
+ return 'compact';
25
+ }
26
+ function heightClassOf(height) {
27
+ if (height >= EXPANDED_HEIGHT)
28
+ return 'expanded';
29
+ if (height >= MEDIUM_HEIGHT)
30
+ return 'medium';
31
+ return 'compact';
32
+ }
10
33
  function sizeClassOf(width, height) {
11
- const widthClass = width >= 1600
12
- ? 'extraLarge'
13
- : width >= 1200
14
- ? 'large'
15
- : width >= 840
16
- ? 'expanded'
17
- : width >= 600
18
- ? 'medium'
19
- : 'compact';
20
- const heightClass = height >= 900 ? 'expanded' : height >= 480 ? 'medium' : 'compact';
21
34
  return {
22
- horizontal: width >= 600 ? 'regular' : 'compact',
23
- vertical: height >= 480 ? 'regular' : 'compact',
24
- widthClass,
25
- heightClass,
35
+ horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',
36
+ vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',
37
+ widthClass: widthClassOf(width),
38
+ heightClass: heightClassOf(height),
39
+ };
40
+ }
41
+
42
+ const EDGE_TOLERANCE = 1;
43
+ function splitViewport(fold, width, height) {
44
+ const whole = [{ x: 0, y: 0, width, height }];
45
+ const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;
46
+ if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)
47
+ return whole;
48
+ if (fold.hingeOrientation === 'vertical') {
49
+ const right = hinge.x + hinge.width;
50
+ const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;
51
+ if (!spansHeight || hinge.x <= 0 || right >= width)
52
+ return whole;
53
+ return [
54
+ { x: 0, y: 0, width: hinge.x, height },
55
+ { x: right, y: 0, width: width - right, height },
56
+ ];
57
+ }
58
+ const bottom = hinge.y + hinge.height;
59
+ const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;
60
+ if (!spansWidth || hinge.y <= 0 || bottom >= height)
61
+ return whole;
62
+ return [
63
+ { x: 0, y: 0, width, height: hinge.y },
64
+ { x: 0, y: bottom, width, height: height - bottom },
65
+ ];
66
+ }
67
+
68
+ const FLAT_FOLD = { state: 'flat', isSeparating: false, posture: 'flat' };
69
+ function webFoldApisAvailable() {
70
+ return (typeof window !== 'undefined' &&
71
+ typeof navigator !== 'undefined' &&
72
+ ('devicePosture' in navigator || 'viewport' in window));
73
+ }
74
+ function webDeviceFoldable() {
75
+ if (!webFoldApisAvailable()) {
76
+ return { foldable: false, supportsTabletop: false };
77
+ }
78
+ const fold = readWebFoldState(window.innerWidth, window.innerHeight);
79
+ const foldable = fold.state === 'half-opened' || (fold.isSeparating && fold.hingeBounds != null);
80
+ const supportsTabletop = foldable && (fold.posture === 'tabletop' || fold.hingeOrientation === 'horizontal');
81
+ return { foldable, supportsTabletop };
82
+ }
83
+ function readWebFoldState(width, height) {
84
+ var _a, _b;
85
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
86
+ return FLAT_FOLD;
87
+ }
88
+ const fromSegments = foldFromViewportSegments(width, height);
89
+ if (fromSegments) {
90
+ return fromSegments;
91
+ }
92
+ const postureType = (_b = (_a = navigator.devicePosture) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : 'continuous';
93
+ if (postureType === 'folded') {
94
+ return { state: 'half-opened', isSeparating: false, posture: 'book' };
95
+ }
96
+ return FLAT_FOLD;
97
+ }
98
+ function foldFromViewportSegments(width, height) {
99
+ var _a;
100
+ const viewport = window.viewport;
101
+ if (!viewport) {
102
+ return null;
103
+ }
104
+ const rawSegments = viewport.segments;
105
+ if (!rawSegments || rawSegments.length !== 2) {
106
+ return null;
107
+ }
108
+ const rects = rawSegments.map((rect) => ({
109
+ x: rect.x,
110
+ y: rect.y,
111
+ width: rect.width,
112
+ height: rect.height,
113
+ }));
114
+ const folded = ((_a = navigator.devicePosture) === null || _a === void 0 ? void 0 : _a.type) === 'folded';
115
+ const state = folded ? 'half-opened' : 'flat';
116
+ const vertical = rects.every((r) => r.y <= 1 && r.height >= height - 1);
117
+ if (vertical) {
118
+ const sorted = [...rects].sort((a, b) => a.x - b.x);
119
+ const left = sorted[0];
120
+ const right = sorted[1];
121
+ const hingeX = left.x + left.width;
122
+ const hingeW = right.x - hingeX;
123
+ if (hingeW < 0) {
124
+ return null;
125
+ }
126
+ const hingeBounds = { x: hingeX, y: 0, width: hingeW, height };
127
+ return finalizeSegmentFold(state, folded, 'vertical', hingeBounds, width, height);
128
+ }
129
+ const horizontal = rects.every((r) => r.x <= 1 && r.width >= width - 1);
130
+ if (horizontal) {
131
+ const sorted = [...rects].sort((a, b) => a.y - b.y);
132
+ const top = sorted[0];
133
+ const bottom = sorted[1];
134
+ const hingeY = top.y + top.height;
135
+ const hingeH = bottom.y - hingeY;
136
+ if (hingeH < 0) {
137
+ return null;
138
+ }
139
+ const hingeBounds = { x: 0, y: hingeY, width, height: hingeH };
140
+ return finalizeSegmentFold(state, folded, 'horizontal', hingeBounds, width, height);
141
+ }
142
+ return null;
143
+ }
144
+ function finalizeSegmentFold(state, folded, hingeOrientation, hingeBounds, width, height) {
145
+ const fold = foldWithHinge(state, folded, hingeOrientation, hingeBounds, true);
146
+ if (splitViewport(fold, width, height).length !== 2) {
147
+ return null;
148
+ }
149
+ return fold;
150
+ }
151
+ function foldWithHinge(state, folded, hingeOrientation, hingeBounds, isSeparating) {
152
+ const posture = !folded ? 'flat' : hingeOrientation === 'horizontal' ? 'tabletop' : 'book';
153
+ const fold = {
154
+ state,
155
+ isSeparating,
156
+ posture,
157
+ hingeOrientation,
158
+ hingeBounds,
26
159
  };
160
+ const gap = hingeOrientation === 'vertical' ? hingeBounds.width : hingeBounds.height;
161
+ if (gap > 0) {
162
+ fold.occludedBounds = Object.assign({}, hingeBounds);
163
+ }
164
+ return fold;
27
165
  }
166
+ function foldStateKey(state) {
167
+ return JSON.stringify(state);
168
+ }
169
+
28
170
  class CapacitorScreenOrientationWeb extends core.WebPlugin {
29
171
  constructor() {
30
- var _a;
172
+ var _a, _b;
31
173
  super();
32
174
  this.pluginVersion = '1.0.0';
175
+ this.lastFoldKey = null;
33
176
  this.lastSizeClass = null;
34
177
  if ((_a = window.screen) === null || _a === void 0 ? void 0 : _a.orientation) {
35
178
  window.screen.orientation.addEventListener('change', () => {
36
179
  this.notifyListeners('screenOrientationChange', {
37
180
  type: this.mapOrientationType(window.screen.orientation.type),
38
181
  });
182
+ this.notifyFoldIfChanged();
39
183
  });
40
184
  }
41
185
  window.addEventListener('resize', () => {
42
- const next = this.readSizeClass();
43
- const previous = JSON.stringify(this.lastSizeClass);
44
- if (previous === JSON.stringify(next))
45
- return;
46
- this.lastSizeClass = next;
47
- this.notifyListeners('sizeClassChange', next);
186
+ this.notifySizeClassIfChanged();
187
+ this.notifyFoldIfChanged();
48
188
  });
189
+ (_b = navigator.devicePosture) === null || _b === void 0 ? void 0 : _b.addEventListener('change', () => {
190
+ this.notifyFoldIfChanged();
191
+ });
192
+ this.lastSizeClass = this.readSizeClass();
193
+ this.lastFoldKey = foldStateKey(readWebFoldState(window.innerWidth, window.innerHeight));
49
194
  }
50
195
  async orientation() {
51
196
  var _a;
@@ -62,8 +207,6 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
62
207
  if (!(screenOrientation === null || screenOrientation === void 0 ? void 0 : screenOrientation.lock)) {
63
208
  throw this.unavailable('Screen Orientation lock not available');
64
209
  }
65
- // bypassOrientationLock is only supported on iOS native platform
66
- // Silently ignore it on web
67
210
  try {
68
211
  await screenOrientation.lock(options.orientation);
69
212
  }
@@ -80,13 +223,10 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
80
223
  screenOrientation.unlock();
81
224
  }
82
225
  async startOrientationTracking(_options) {
83
- // Motion-based orientation tracking is only supported on iOS
84
- // Silently ignore on web
85
226
  console.warn('Motion-based orientation tracking is not available on web platform', _options);
86
227
  }
87
228
  async stopOrientationTracking() {
88
- // Motion-based orientation tracking is only supported on iOS
89
- // Silently ignore on web
229
+ // No-op on web
90
230
  }
91
231
  async isOrientationLocked() {
92
232
  const orientationResult = await this.orientation();
@@ -96,10 +236,10 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
96
236
  };
97
237
  }
98
238
  async isDeviceFoldable() {
99
- return { foldable: false, supportsTabletop: false };
239
+ return webDeviceFoldable();
100
240
  }
101
241
  async getFoldState() {
102
- return FLAT_FOLD;
242
+ return readWebFoldState(window.innerWidth, window.innerHeight);
103
243
  }
104
244
  async getHingeAngle() {
105
245
  return { angle: null, status: null };
@@ -122,6 +262,23 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
122
262
  readSizeClass() {
123
263
  return sizeClassOf(window.innerWidth, window.innerHeight);
124
264
  }
265
+ notifySizeClassIfChanged() {
266
+ const next = this.readSizeClass();
267
+ const previous = JSON.stringify(this.lastSizeClass);
268
+ if (previous === JSON.stringify(next))
269
+ return;
270
+ this.lastSizeClass = next;
271
+ this.notifyListeners('sizeClassChange', next);
272
+ }
273
+ notifyFoldIfChanged() {
274
+ const next = readWebFoldState(window.innerWidth, window.innerHeight);
275
+ const key = foldStateKey(next);
276
+ if (key === this.lastFoldKey) {
277
+ return;
278
+ }
279
+ this.lastFoldKey = key;
280
+ this.notifyListeners('foldStateChange', next);
281
+ }
125
282
  mapOrientationType(type) {
126
283
  if (type.includes('portrait-primary') || type === 'portrait-primary') {
127
284
  return 'portrait-primary';
@@ -135,7 +292,7 @@ class CapacitorScreenOrientationWeb extends core.WebPlugin {
135
292
  if (type.includes('landscape-secondary') || type === 'landscape-secondary') {
136
293
  return 'landscape-secondary';
137
294
  }
138
- return 'portrait-primary'; // default fallback
295
+ return 'portrait-primary';
139
296
  }
140
297
  }
141
298
 
@@ -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';\nconst FLAT_FOLD = { state: 'flat', isSeparating: false, posture: 'flat' };\nexport function sizeClassOf(width, height) {\n const widthClass = width >= 1600\n ? 'extraLarge'\n : width >= 1200\n ? 'large'\n : width >= 840\n ? 'expanded'\n : width >= 600\n ? 'medium'\n : 'compact';\n const heightClass = height >= 900 ? 'expanded' : height >= 480 ? 'medium' : 'compact';\n return {\n horizontal: width >= 600 ? 'regular' : 'compact',\n vertical: height >= 480 ? 'regular' : 'compact',\n widthClass,\n heightClass,\n };\n}\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a;\n super();\n this.pluginVersion = '1.0.0';\n this.lastSizeClass = null;\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 window.addEventListener('resize', () => {\n const next = this.readSizeClass();\n const previous = JSON.stringify(this.lastSizeClass);\n if (previous === JSON.stringify(next))\n return;\n this.lastSizeClass = next;\n this.notifyListeners('sizeClassChange', next);\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 isDeviceFoldable() {\n return { foldable: false, supportsTabletop: false };\n }\n async getFoldState() {\n return FLAT_FOLD;\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null, inset: 0 };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getSizeClass() {\n return this.readSizeClass();\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n readSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\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;;ACFD,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE;AAClE,SAAS,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE;AAC3C,IAAI,MAAM,UAAU,GAAG,KAAK,IAAI;AAChC,UAAU;AACV,UAAU,KAAK,IAAI;AACnB,cAAc;AACd,c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cjs.js","sources":["esm/index.js","esm/size-class.js","esm/segments.js","esm/web-fold.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","const MEDIUM_WIDTH = 600;\nconst EXPANDED_WIDTH = 840;\nconst LARGE_WIDTH = 1200;\nconst EXTRA_LARGE_WIDTH = 1600;\nconst MEDIUM_HEIGHT = 480;\nconst EXPANDED_HEIGHT = 900;\nfunction widthClassOf(width) {\n if (width >= EXTRA_LARGE_WIDTH)\n return 'extraLarge';\n if (width >= LARGE_WIDTH)\n return 'large';\n if (width >= EXPANDED_WIDTH)\n return 'expanded';\n if (width >= MEDIUM_WIDTH)\n return 'medium';\n return 'compact';\n}\nfunction heightClassOf(height) {\n if (height >= EXPANDED_HEIGHT)\n return 'expanded';\n if (height >= MEDIUM_HEIGHT)\n return 'medium';\n return 'compact';\n}\nexport function sizeClassOf(width, height) {\n return {\n horizontal: width >= MEDIUM_WIDTH ? 'regular' : 'compact',\n vertical: height >= MEDIUM_HEIGHT ? 'regular' : 'compact',\n widthClass: widthClassOf(width),\n heightClass: heightClassOf(height),\n };\n}\n//# sourceMappingURL=size-class.js.map","const EDGE_TOLERANCE = 1;\nexport function splitViewport(fold, width, height) {\n const whole = [{ x: 0, y: 0, width, height }];\n const hinge = fold === null || fold === void 0 ? void 0 : fold.hingeBounds;\n if (!(fold === null || fold === void 0 ? void 0 : fold.isSeparating) || !hinge)\n return whole;\n if (fold.hingeOrientation === 'vertical') {\n const right = hinge.x + hinge.width;\n const spansHeight = hinge.y <= EDGE_TOLERANCE && hinge.y + hinge.height >= height - EDGE_TOLERANCE;\n if (!spansHeight || hinge.x <= 0 || right >= width)\n return whole;\n return [\n { x: 0, y: 0, width: hinge.x, height },\n { x: right, y: 0, width: width - right, height },\n ];\n }\n const bottom = hinge.y + hinge.height;\n const spansWidth = hinge.x <= EDGE_TOLERANCE && hinge.x + hinge.width >= width - EDGE_TOLERANCE;\n if (!spansWidth || hinge.y <= 0 || bottom >= height)\n return whole;\n return [\n { x: 0, y: 0, width, height: hinge.y },\n { x: 0, y: bottom, width, height: height - bottom },\n ];\n}\n//# sourceMappingURL=segments.js.map","import { splitViewport } from './segments';\nconst FLAT_FOLD = { state: 'flat', isSeparating: false, posture: 'flat' };\nexport function webFoldApisAvailable() {\n return (typeof window !== 'undefined' &&\n typeof navigator !== 'undefined' &&\n ('devicePosture' in navigator || 'viewport' in window));\n}\nexport function webDeviceFoldable() {\n if (!webFoldApisAvailable()) {\n return { foldable: false, supportsTabletop: false };\n }\n const fold = readWebFoldState(window.innerWidth, window.innerHeight);\n const foldable = fold.state === 'half-opened' || (fold.isSeparating && fold.hingeBounds != null);\n const supportsTabletop = foldable && (fold.posture === 'tabletop' || fold.hingeOrientation === 'horizontal');\n return { foldable, supportsTabletop };\n}\nexport function readWebFoldState(width, height) {\n var _a, _b;\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return FLAT_FOLD;\n }\n const fromSegments = foldFromViewportSegments(width, height);\n if (fromSegments) {\n return fromSegments;\n }\n const postureType = (_b = (_a = navigator.devicePosture) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : 'continuous';\n if (postureType === 'folded') {\n return { state: 'half-opened', isSeparating: false, posture: 'book' };\n }\n return FLAT_FOLD;\n}\nfunction foldFromViewportSegments(width, height) {\n var _a;\n const viewport = window.viewport;\n if (!viewport) {\n return null;\n }\n const rawSegments = viewport.segments;\n if (!rawSegments || rawSegments.length !== 2) {\n return null;\n }\n const rects = rawSegments.map((rect) => ({\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n }));\n const folded = ((_a = navigator.devicePosture) === null || _a === void 0 ? void 0 : _a.type) === 'folded';\n const state = folded ? 'half-opened' : 'flat';\n const vertical = rects.every((r) => r.y <= 1 && r.height >= height - 1);\n if (vertical) {\n const sorted = [...rects].sort((a, b) => a.x - b.x);\n const left = sorted[0];\n const right = sorted[1];\n const hingeX = left.x + left.width;\n const hingeW = right.x - hingeX;\n if (hingeW < 0) {\n return null;\n }\n const hingeBounds = { x: hingeX, y: 0, width: hingeW, height };\n return finalizeSegmentFold(state, folded, 'vertical', hingeBounds, width, height);\n }\n const horizontal = rects.every((r) => r.x <= 1 && r.width >= width - 1);\n if (horizontal) {\n const sorted = [...rects].sort((a, b) => a.y - b.y);\n const top = sorted[0];\n const bottom = sorted[1];\n const hingeY = top.y + top.height;\n const hingeH = bottom.y - hingeY;\n if (hingeH < 0) {\n return null;\n }\n const hingeBounds = { x: 0, y: hingeY, width, height: hingeH };\n return finalizeSegmentFold(state, folded, 'horizontal', hingeBounds, width, height);\n }\n return null;\n}\nfunction finalizeSegmentFold(state, folded, hingeOrientation, hingeBounds, width, height) {\n const fold = foldWithHinge(state, folded, hingeOrientation, hingeBounds, true);\n if (splitViewport(fold, width, height).length !== 2) {\n return null;\n }\n return fold;\n}\nfunction foldWithHinge(state, folded, hingeOrientation, hingeBounds, isSeparating) {\n const posture = !folded ? 'flat' : hingeOrientation === 'horizontal' ? 'tabletop' : 'book';\n const fold = {\n state,\n isSeparating,\n posture,\n hingeOrientation,\n hingeBounds,\n };\n const gap = hingeOrientation === 'vertical' ? hingeBounds.width : hingeBounds.height;\n if (gap > 0) {\n fold.occludedBounds = Object.assign({}, hingeBounds);\n }\n return fold;\n}\nexport function foldStateKey(state) {\n return JSON.stringify(state);\n}\n//# sourceMappingURL=web-fold.js.map","import { WebPlugin } from '@capacitor/core';\nimport { sizeClassOf } from './size-class';\nimport { foldStateKey, readWebFoldState, webDeviceFoldable } from './web-fold';\nexport { sizeClassOf } from './size-class';\nexport class CapacitorScreenOrientationWeb extends WebPlugin {\n constructor() {\n var _a, _b;\n super();\n this.pluginVersion = '1.0.0';\n this.lastFoldKey = null;\n this.lastSizeClass = null;\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 this.notifyFoldIfChanged();\n });\n }\n window.addEventListener('resize', () => {\n this.notifySizeClassIfChanged();\n this.notifyFoldIfChanged();\n });\n (_b = navigator.devicePosture) === null || _b === void 0 ? void 0 : _b.addEventListener('change', () => {\n this.notifyFoldIfChanged();\n });\n this.lastSizeClass = this.readSizeClass();\n this.lastFoldKey = foldStateKey(readWebFoldState(window.innerWidth, window.innerHeight));\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 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 console.warn('Motion-based orientation tracking is not available on web platform', _options);\n }\n async stopOrientationTracking() {\n // No-op 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 isDeviceFoldable() {\n return webDeviceFoldable();\n }\n async getFoldState() {\n return readWebFoldState(window.innerWidth, window.innerHeight);\n }\n async getHingeAngle() {\n return { angle: null, status: null };\n }\n async getReservedRegions() {\n return { regions: [] };\n }\n async getBarPlacement() {\n return { verticalBarEdge: null, inset: 0 };\n }\n async setVerticalBarBehavior() {\n return { applied: false };\n }\n async getSizeClass() {\n return this.readSizeClass();\n }\n async getPluginVersion() {\n return { version: this.pluginVersion };\n }\n readSizeClass() {\n return sizeClassOf(window.innerWidth, window.innerHeight);\n }\n notifySizeClassIfChanged() {\n const next = this.readSizeClass();\n const previous = JSON.stringify(this.lastSizeClass);\n if (previous === JSON.stringify(next))\n return;\n this.lastSizeClass = next;\n this.notifyListeners('sizeClassChange', next);\n }\n notifyFoldIfChanged() {\n const next = readWebFoldState(window.innerWidth, window.innerHeight);\n const key = foldStateKey(next);\n if (key === this.lastFoldKey) {\n return;\n }\n this.lastFoldKey = key;\n this.notifyListeners('foldStateChange', next);\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';\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;;ACHD,MAAM,YAAY,GAAG,GAAG;AACxB,MAAM,cAAc,GAAG,GAAG;AAC1B,MAAM,WAAW,GAAG,IAAI;AACxB,MAAM,iBAAiB,GAAG,IAAI;AAC9B,MAAM,aAAa,GAAG,GAAG;AACzB,MAAM,eAAe,GAAG,GAAG;AAC3B,SAAS,YAAY,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,KAAK,IAAI,iBAAiB;AAClC,QA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