@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.
@@ -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 {};
@@ -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;
@@ -238,8 +238,8 @@
238
238
 
239
239
  let supportsFullscreen = $state(false);
240
240
 
241
- function updateIosWidthHeight() {
242
- if (isPwa && isAppleMobile) {
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('updateIosWidthHeight', {
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
- updateIosWidthHeight();
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 (isPwa && isAppleMobile) {
319
- updateIosWidthHeight();
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
- updateIosWidthHeight();
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}
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.38",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"