@hkdigital/lib-core 0.5.36 → 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,16 +238,19 @@
|
|
|
238
238
|
|
|
239
239
|
let supportsFullscreen = $state(false);
|
|
240
240
|
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
241
|
+
function updateIosWidthHeightAndOrientation() {
|
|
242
|
+
if (isAppleMobile) {
|
|
243
|
+
|
|
244
|
+
// unreliable on ios >>
|
|
243
245
|
// const angle = screen.orientation.angle;
|
|
244
|
-
if( window.matchMedia('(orientation: portrait)').matches ) {
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
|
|
249
|
-
}
|
|
246
|
+
// if( window.matchMedia('(orientation: portrait)').matches ) {
|
|
247
|
+
// isLandscape = false;
|
|
248
|
+
// }
|
|
249
|
+
// else {
|
|
250
|
+
// isLandscape = true;
|
|
251
|
+
// }
|
|
250
252
|
|
|
253
|
+
// unreliable on ios >>
|
|
251
254
|
// switch( screen.orientation.type ) {
|
|
252
255
|
// case "portrait-primary":
|
|
253
256
|
// case "portrait-secondary":
|
|
@@ -271,9 +274,17 @@
|
|
|
271
274
|
iosWindowWidth = window.innerWidth;
|
|
272
275
|
iosWindowHeight = window.innerHeight;
|
|
273
276
|
|
|
277
|
+
if( iosWindowHeight > iosWindowWidth )
|
|
278
|
+
{
|
|
279
|
+
isLandscape = false;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
isLandscape = true;
|
|
283
|
+
}
|
|
284
|
+
|
|
274
285
|
if( debug )
|
|
275
286
|
{
|
|
276
|
-
console.debug('
|
|
287
|
+
console.debug('updateIosWidthHeightAndOrientation', {
|
|
277
288
|
'screen.orientation.type': screen.orientation.type,
|
|
278
289
|
isLandscape,
|
|
279
290
|
'window.innerWidth': window.innerWidth,
|
|
@@ -298,16 +309,17 @@
|
|
|
298
309
|
|
|
299
310
|
isPwa = getIsPwa();
|
|
300
311
|
|
|
301
|
-
|
|
312
|
+
updateIosWidthHeightAndOrientation();
|
|
302
313
|
|
|
303
314
|
// Listen for orientation changes using matchMedia (works on all iOS)
|
|
304
315
|
const portraitMediaQuery = window.matchMedia('(orientation: portrait)');
|
|
305
316
|
const handleOrientationChange = (e) => {
|
|
306
317
|
// Update iOS dimensions if needed
|
|
307
|
-
if (
|
|
308
|
-
|
|
318
|
+
if (isAppleMobile) {
|
|
319
|
+
updateIosWidthHeightAndOrientation();
|
|
309
320
|
} else {
|
|
310
321
|
// For non-iOS, matchMedia is reliable
|
|
322
|
+
// as well is window width and height
|
|
311
323
|
isLandscape = !e.matches;
|
|
312
324
|
}
|
|
313
325
|
};
|
|
@@ -337,7 +349,7 @@
|
|
|
337
349
|
|
|
338
350
|
// Force iOS dimension update when app becomes visible
|
|
339
351
|
if (isPwa && isAppleMobile) {
|
|
340
|
-
|
|
352
|
+
updateIosWidthHeightAndOrientation();
|
|
341
353
|
}
|
|
342
354
|
}
|
|
343
355
|
};
|
|
@@ -533,7 +545,7 @@
|
|
|
533
545
|
gameHeight
|
|
534
546
|
})}
|
|
535
547
|
</ScaledContainer>
|
|
536
|
-
{:else if isMobile && snippetInstallOnHomeScreen && !isDevMode}
|
|
548
|
+
{:else if isMobile && snippetInstallOnHomeScreen && !isPwa && !isDevMode}
|
|
537
549
|
<!-- Require install on home screen on mobile -->
|
|
538
550
|
<ScaledContainer
|
|
539
551
|
enableScaling={enableScaling}
|