inviton-powerduck 0.0.73 → 0.0.75

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.
@@ -7,7 +7,7 @@ export default class KeyboardOpenTracker {
7
7
  (window as any)._keyboardOpenTrackerBound = true;
8
8
 
9
9
  const getOrientation = () => {
10
- return window.screen.width > window.screen.height ? 'landscape' : 'portrait';
10
+ return window.matchMedia('(orientation: portrait)').matches ? 'portrait' : 'landscape';
11
11
  }
12
12
 
13
13
  const getScreenHeight = () => {
@@ -17,12 +17,12 @@ export default class KeyboardOpenTracker {
17
17
  let lastOrientation = getOrientation();
18
18
  const handleResize = () => {
19
19
  const currentOrientation = getOrientation();
20
- const currentInnerHeight = window.innerHeight;
20
+ const currentInnerHeight = window.visualViewport?.height ?? window.innerHeight;
21
21
  const screenHeight = getScreenHeight();
22
22
 
23
23
  // Different thresholds for portrait/landscape
24
- const THRESHOLD_PORTRAIT = 150;
25
- const THRESHOLD_LANDSCAPE = 100;
24
+ const THRESHOLD_PORTRAIT = 300;
25
+ const THRESHOLD_LANDSCAPE = 190;
26
26
 
27
27
  const isPortrait = currentOrientation === 'portrait';
28
28
  const threshold = isPortrait ? THRESHOLD_PORTRAIT : THRESHOLD_LANDSCAPE;
@@ -30,7 +30,7 @@ export default class KeyboardOpenTracker {
30
30
  // Reset baseline when orientation changes
31
31
  if (currentOrientation !== lastOrientation) {
32
32
  lastOrientation = currentOrientation;
33
- console.log(`[Resize] Orientation changed → ${currentOrientation}`);
33
+ return;
34
34
  }
35
35
 
36
36
  const heightDiff = screenHeight - currentInnerHeight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": " vite build && vue-tsc --declaration --emitDeclarationOnly",