@hkdigital/lib-core 0.5.37 → 0.5.39

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.
@@ -33,3 +33,4 @@ export type LogEventData = {
33
33
  export type LogEvent = LogEventData & {
34
34
  eventName?: string;
35
35
  };
36
+ export type Logger = import("./internal/logger/Logger.js").default;
@@ -18,4 +18,8 @@
18
18
  * eventName - Original event name if log came from an event (optional)
19
19
  */
20
20
 
21
+ /**
22
+ * @typedef {import('./internal/logger/Logger.js').default} Logger
23
+ */
24
+
21
25
  export default {};
@@ -392,7 +392,7 @@ export async function httpRequest(options) {
392
392
 
393
393
  if (!isTestEnv) {
394
394
  if (cachedResponse) {
395
- console.debug(`http:cache-hit [${url.pathname}]`);
395
+ // console.debug(`http:cache-hit [${url.pathname}]`);
396
396
  // console.debug(`cached-response has body: ${!!cachedResponse.body}`);
397
397
  // console.debug(`cached-response content-length: ${cachedResponse.headers.get('content-length')}`);
398
398
  return cachedResponse;
@@ -138,20 +138,20 @@
138
138
  windowWidth &&
139
139
  windowHeight
140
140
  ) {
141
- updateIosWidthHeight();
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 updateIosWidthHeight()
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
- updateIosWidthHeight();
154
+ updateIosWidthHeightAndOrientation();
155
155
  } else {
156
156
  // For non-iOS, matchMedia is reliable
157
157
  isLandscape = !isPortraitMedia;
@@ -166,6 +166,8 @@
166
166
  console.log('[GameBox] windowWidth/Height:', windowWidth, windowHeight);
167
167
  console.log('[GameBox] iosWindowWidth/Height:',
168
168
  iosWindowWidth, iosWindowHeight);
169
+
170
+ console.log( {isPwa, isAppleMobile, isMobile, isIos, isAndroid, isFullscreen} );
169
171
  }
170
172
  });
171
173
 
@@ -238,8 +240,8 @@
238
240
 
239
241
  let supportsFullscreen = $state(false);
240
242
 
241
- function updateIosWidthHeight() {
242
- if (isPwa && isAppleMobile) {
243
+ function updateIosWidthHeightAndOrientation() {
244
+ if (isAppleMobile) {
243
245
 
244
246
  // unreliable on ios >>
245
247
  // const angle = screen.orientation.angle;
@@ -284,7 +286,7 @@
284
286
 
285
287
  if( debug )
286
288
  {
287
- console.debug('updateIosWidthHeight', {
289
+ console.debug('updateIosWidthHeightAndOrientation', {
288
290
  'screen.orientation.type': screen.orientation.type,
289
291
  isLandscape,
290
292
  'window.innerWidth': window.innerWidth,
@@ -309,16 +311,17 @@
309
311
 
310
312
  isPwa = getIsPwa();
311
313
 
312
- updateIosWidthHeight();
314
+ updateIosWidthHeightAndOrientation();
313
315
 
314
316
  // Listen for orientation changes using matchMedia (works on all iOS)
315
317
  const portraitMediaQuery = window.matchMedia('(orientation: portrait)');
316
318
  const handleOrientationChange = (e) => {
317
319
  // Update iOS dimensions if needed
318
- if (isPwa && isAppleMobile) {
319
- updateIosWidthHeight();
320
+ if (isAppleMobile) {
321
+ updateIosWidthHeightAndOrientation();
320
322
  } else {
321
323
  // For non-iOS, matchMedia is reliable
324
+ // as well is window width and height
322
325
  isLandscape = !e.matches;
323
326
  }
324
327
  };
@@ -348,7 +351,7 @@
348
351
 
349
352
  // Force iOS dimension update when app becomes visible
350
353
  if (isPwa && isAppleMobile) {
351
- updateIosWidthHeight();
354
+ updateIosWidthHeightAndOrientation();
352
355
  }
353
356
  }
354
357
  };
@@ -544,7 +547,7 @@
544
547
  gameHeight
545
548
  })}
546
549
  </ScaledContainer>
547
- {:else if isMobile && snippetInstallOnHomeScreen && !isDevMode}
550
+ {:else if isMobile && snippetInstallOnHomeScreen && !isPwa && !isDevMode}
548
551
  <!-- Require install on home screen on mobile -->
549
552
  <ScaledContainer
550
553
  enableScaling={enableScaling}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.37",
3
+ "version": "0.5.39",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"