termites 1.0.9 → 1.0.10

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +15 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termites",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Web terminal with server-client architecture for remote shell access",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -1085,14 +1085,27 @@ class TermitesServer {
1085
1085
  }));
1086
1086
  }
1087
1087
  }
1088
+ function handleViewportResize() {
1089
+ // Adjust body height to visual viewport (handles mobile keyboard)
1090
+ if (window.visualViewport) {
1091
+ const vh = window.visualViewport.height;
1092
+ document.body.style.height = vh + 'px';
1093
+ // Scroll viewport to top to prevent offset issues
1094
+ window.scrollTo(0, 0);
1095
+ }
1096
+ handleResize();
1097
+ }
1088
1098
  window.addEventListener('resize', handleResize);
1089
1099
  window.addEventListener('orientationchange', () => {
1090
1100
  // Delay fit after orientation change to let browser settle
1091
- setTimeout(handleResize, 100);
1101
+ setTimeout(handleViewportResize, 100);
1092
1102
  });
1093
1103
  // Also handle visual viewport changes (mobile keyboard show/hide)
1094
1104
  if (window.visualViewport) {
1095
- window.visualViewport.addEventListener('resize', handleResize);
1105
+ window.visualViewport.addEventListener('resize', handleViewportResize);
1106
+ window.visualViewport.addEventListener('scroll', () => window.scrollTo(0, 0));
1107
+ // Initial adjustment
1108
+ handleViewportResize();
1096
1109
  }
1097
1110
  connect();
1098
1111
  applyTheme(currentTheme);