@hkdigital/lib-core 0.5.37 → 0.5.38
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/logging/typedef.js
CHANGED
|
@@ -138,20 +138,20 @@
|
|
|
138
138
|
windowWidth &&
|
|
139
139
|
windowHeight
|
|
140
140
|
) {
|
|
141
|
-
|
|
141
|
+
updateIosWidthHeightAndOrientation();
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
$effect(() => {
|
|
146
146
|
// Use matchMedia as a trigger for orientation changes
|
|
147
|
-
// The actual orientation is determined in
|
|
147
|
+
// The actual orientation is determined in updateIosWidthHeightAndOrientation()
|
|
148
148
|
if (typeof window !== 'undefined') {
|
|
149
149
|
const isPortraitMedia =
|
|
150
150
|
window.matchMedia('(orientation: portrait)').matches;
|
|
151
151
|
|
|
152
152
|
// Trigger iOS dimension update when orientation might have changed
|
|
153
153
|
if (isPwa && isAppleMobile) {
|
|
154
|
-
|
|
154
|
+
updateIosWidthHeightAndOrientation();
|
|
155
155
|
} else {
|
|
156
156
|
// For non-iOS, matchMedia is reliable
|
|
157
157
|
isLandscape = !isPortraitMedia;
|
|
@@ -238,8 +238,8 @@
|
|
|
238
238
|
|
|
239
239
|
let supportsFullscreen = $state(false);
|
|
240
240
|
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
241
|
+
function updateIosWidthHeightAndOrientation() {
|
|
242
|
+
if (isAppleMobile) {
|
|
243
243
|
|
|
244
244
|
// unreliable on ios >>
|
|
245
245
|
// const angle = screen.orientation.angle;
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
|
|
285
285
|
if( debug )
|
|
286
286
|
{
|
|
287
|
-
console.debug('
|
|
287
|
+
console.debug('updateIosWidthHeightAndOrientation', {
|
|
288
288
|
'screen.orientation.type': screen.orientation.type,
|
|
289
289
|
isLandscape,
|
|
290
290
|
'window.innerWidth': window.innerWidth,
|
|
@@ -309,16 +309,17 @@
|
|
|
309
309
|
|
|
310
310
|
isPwa = getIsPwa();
|
|
311
311
|
|
|
312
|
-
|
|
312
|
+
updateIosWidthHeightAndOrientation();
|
|
313
313
|
|
|
314
314
|
// Listen for orientation changes using matchMedia (works on all iOS)
|
|
315
315
|
const portraitMediaQuery = window.matchMedia('(orientation: portrait)');
|
|
316
316
|
const handleOrientationChange = (e) => {
|
|
317
317
|
// Update iOS dimensions if needed
|
|
318
|
-
if (
|
|
319
|
-
|
|
318
|
+
if (isAppleMobile) {
|
|
319
|
+
updateIosWidthHeightAndOrientation();
|
|
320
320
|
} else {
|
|
321
321
|
// For non-iOS, matchMedia is reliable
|
|
322
|
+
// as well is window width and height
|
|
322
323
|
isLandscape = !e.matches;
|
|
323
324
|
}
|
|
324
325
|
};
|
|
@@ -348,7 +349,7 @@
|
|
|
348
349
|
|
|
349
350
|
// Force iOS dimension update when app becomes visible
|
|
350
351
|
if (isPwa && isAppleMobile) {
|
|
351
|
-
|
|
352
|
+
updateIosWidthHeightAndOrientation();
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
};
|
|
@@ -544,7 +545,7 @@
|
|
|
544
545
|
gameHeight
|
|
545
546
|
})}
|
|
546
547
|
</ScaledContainer>
|
|
547
|
-
{:else if isMobile && snippetInstallOnHomeScreen && !isDevMode}
|
|
548
|
+
{:else if isMobile && snippetInstallOnHomeScreen && !isPwa && !isDevMode}
|
|
548
549
|
<!-- Require install on home screen on mobile -->
|
|
549
550
|
<ScaledContainer
|
|
550
551
|
enableScaling={enableScaling}
|