@littlepartytime/dev-kit 1.22.4-debug.0 → 1.22.4

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.
@@ -11,12 +11,22 @@
11
11
  html { height: 100%; }
12
12
  body { height: 100%; min-height: 100%; }
13
13
 
14
- /* ── Game sandbox: mirrors platform globals.css ── */
14
+ /* ── Game sandbox: based on platform globals.css ── */
15
+ /* Platform uses height:100% which works in PWA/Capacitor.
16
+ In a regular browser, keyboard interaction breaks the CSS
17
+ height chain for descendant elements. Using flex + stretch
18
+ forces game renderers to fill the container regardless. */
15
19
  .game-sandbox {
16
20
  height: 100%;
21
+ display: flex;
22
+ flex-direction: column;
17
23
  padding-top: env(safe-area-inset-top, 0px);
18
24
  padding-bottom: env(safe-area-inset-bottom, 0px);
19
25
  }
26
+ .game-sandbox > * {
27
+ flex: 1;
28
+ min-height: 0;
29
+ }
20
30
  .game-sandbox, .game-sandbox * {
21
31
  -webkit-user-select: auto;
22
32
  user-select: auto;
@@ -21,49 +21,20 @@ const gameOuterStyle: React.CSSProperties = {
21
21
  };
22
22
 
23
23
  /**
24
- * Diagnostic: track viewport values for debugging keyboard/layout issues.
25
- * Shows a small overlay on screen with real-time values.
26
- * TODO: Remove after debugging is complete.
24
+ * Track viewport height for mobile keyboard handling.
25
+ * In regular Safari (non-PWA), 100dvh doesn't shrink with keyboard.
26
+ * Uses VisualViewport to detect keyboard and switch to pixel height.
27
27
  */
28
- interface ViewportDebug {
29
- height: string;
30
- debug: {
31
- vvHeight: number;
32
- vvOffsetTop: number;
33
- innerHeight: number;
34
- documentHeight: number;
35
- scrollY: number;
36
- rootHeight: number;
37
- };
38
- }
39
-
40
- function useViewportHeight(): ViewportDebug {
28
+ function useViewportHeight(): string {
41
29
  const [height, setHeight] = useState('100dvh');
42
- const [debug, setDebug] = useState({
43
- vvHeight: 0, vvOffsetTop: 0, innerHeight: 0,
44
- documentHeight: 0, scrollY: 0, rootHeight: 0,
45
- });
46
30
  const initialHeight = useRef(0);
47
31
 
48
32
  useEffect(() => {
49
33
  const vv = window.visualViewport;
50
34
  if (!vv) return;
51
-
52
35
  initialHeight.current = vv.height;
53
-
54
36
  const KEYBOARD_THRESHOLD = 100;
55
-
56
37
  const update = () => {
57
- const root = document.getElementById('root');
58
- setDebug({
59
- vvHeight: Math.round(vv.height),
60
- vvOffsetTop: Math.round(vv.offsetTop),
61
- innerHeight: window.innerHeight,
62
- documentHeight: document.documentElement.clientHeight,
63
- scrollY: Math.round(window.scrollY),
64
- rootHeight: root ? root.clientHeight : 0,
65
- });
66
-
67
38
  window.scrollTo(0, 0);
68
39
  const shrunk = initialHeight.current - vv.height;
69
40
  if (shrunk > KEYBOARD_THRESHOLD) {
@@ -72,8 +43,6 @@ function useViewportHeight(): ViewportDebug {
72
43
  setHeight('100dvh');
73
44
  }
74
45
  };
75
-
76
- update();
77
46
  vv.addEventListener('resize', update);
78
47
  vv.addEventListener('scroll', update);
79
48
  return () => {
@@ -82,18 +51,11 @@ function useViewportHeight(): ViewportDebug {
82
51
  };
83
52
  }, []);
84
53
 
85
- return { height, debug };
54
+ return height;
86
55
  }
87
56
 
88
- const debugOverlayStyle: React.CSSProperties = {
89
- position: 'fixed', bottom: 0, left: 0, right: 0,
90
- background: 'rgba(0,0,0,0.85)', color: '#0f0',
91
- fontSize: 10, fontFamily: 'monospace', padding: 4,
92
- zIndex: 99999, pointerEvents: 'none', lineHeight: 1.4,
93
- };
94
-
95
57
  export default function Mobile() {
96
- const { height: viewportHeight, debug } = useViewportHeight();
58
+ const viewportHeight = useViewportHeight();
97
59
  const [socket, setSocket] = useState<Socket | null>(null);
98
60
  const [nickname, setNickname] = useState('');
99
61
  const [joined, setJoined] = useState(false);
@@ -263,10 +225,6 @@ export default function Mobile() {
263
225
  )}
264
226
  </div>
265
227
  </div>
266
- {/* DEBUG: viewport diagnostic overlay — remove after fixing */}
267
- <div style={debugOverlayStyle}>
268
- container: {viewportHeight} | vv: {debug.vvHeight} | vvOff: {debug.vvOffsetTop} | inner: {debug.innerHeight} | doc: {debug.documentHeight} | scrollY: {debug.scrollY} | root: {debug.rootHeight}
269
- </div>
270
228
  </div>
271
229
  );
272
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@littlepartytime/dev-kit",
3
- "version": "1.22.4-debug.0",
3
+ "version": "1.22.4",
4
4
  "description": "Development toolkit CLI for Little Party Time game developers",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",