@tantawowa/hosanna-ui 2.4.0 → 2.4.1

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.
@@ -2,8 +2,8 @@
2
2
  "schemaVersion": 2,
3
3
  "artifact": "npm-sdk",
4
4
  "packageName": "@tantawowa/hosanna-ui",
5
- "version": "2.4.0",
6
- "sourceCommit": "c420c06f97b11a9e20dce70275421978bbf84c98",
5
+ "version": "2.4.1",
6
+ "sourceCommit": "0af275e64508b64eab71ec768177a7d7a08d3bce",
7
7
  "files": [
8
8
  {
9
9
  "path": "LICENSE",
@@ -1691,7 +1691,7 @@
1691
1691
  },
1692
1692
  {
1693
1693
  "path": "src/hosanna-list/CollectionViewDataSource.ts",
1694
- "sha256": "13b31a5cb9e664f78bc0eb28c0e51caebffdc1830faa150c3bef77aae01a1406"
1694
+ "sha256": "f61f5e205ca826dbb9651b9b658a1a5159b32b8f9e906d97800787be77b9790c"
1695
1695
  },
1696
1696
  {
1697
1697
  "path": "src/hosanna-list/CollectionViewDataSourceUtils.ts",
@@ -2451,7 +2451,7 @@
2451
2451
  },
2452
2452
  {
2453
2453
  "path": "src/hosanna-ui/targets/web/app/WebAsyncManagerTask.ts",
2454
- "sha256": "8a0671a73bdaf4a92d4973ceeb997277153429b9451bf0f191f11ff69de39847"
2454
+ "sha256": "c1a60cfa5cbca5339c2c0cfd3333812f6125a9e8a8d0b819856c70268dbe98d4"
2455
2455
  },
2456
2456
  {
2457
2457
  "path": "src/hosanna-ui/targets/web/app/web-input-adapter-profile.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tantawowa/hosanna-ui",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Hosanna UI source SDK for Roku and its browser emulator",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -415,10 +415,10 @@ export class CollectionViewDataSource {
415
415
  }
416
416
 
417
417
  private resolveItemInsertIndex(index: number | 'end' | 'end-1' | 'end-2' | 'end - 1' | 'end - 2', length: number): number {
418
+ if (typeof index === 'number') return Math.max(0, Math.min(index, length));
418
419
  if (index === 'end') return length;
419
420
  if (index === 'end-1' || index === 'end - 1') return Math.max(0, length - 1);
420
- if (index === 'end-2' || index === 'end - 2') return Math.max(0, length - 2);
421
- return Math.max(0, Math.min(index, length));
421
+ return Math.max(0, length - 2);
422
422
  }
423
423
 
424
424
 
@@ -6,7 +6,12 @@ import {
6
6
  IAsyncCommand,
7
7
  IAsyncEvent,
8
8
  } from '@hs-src/hosanna-ui/async/AsyncApi';
9
- import { createWebTaskGlobalAA, runWithGlobalAA } from '@hs-src/hosanna-bridge-targets/web/sg/sg-global-functions-web';
9
+ import type { createWebTaskGlobalAA, runWithGlobalAA } from '@hs-src/hosanna-bridge-targets/web/sg/sg-global-functions-web';
10
+
11
+ const webGlobals = globalThis as typeof globalThis & {
12
+ hs_createWebTaskGlobalAA: typeof createWebTaskGlobalAA;
13
+ hs_runWithGlobalAA: typeof runWithGlobalAA;
14
+ };
10
15
 
11
16
  /**
12
17
  * WebAsyncManagerTask is a specialized SGTask for managing async commands and events on the web platform.
@@ -64,9 +69,8 @@ export class WebAsyncManagerTask extends WebSGTask {
64
69
  }
65
70
 
66
71
  const appAA = GetGlobalAA();
67
- const taskAA = createWebTaskGlobalAA(this.id || 'unknown', appAA, this);
68
- this.taskAA = taskAA;
69
- runWithGlobalAA(taskAA, () => {
72
+ this.taskAA = webGlobals.hs_createWebTaskGlobalAA(this.id || 'unknown', appAA, this);
73
+ this.runTaskScoped(() => {
70
74
  configureHosannaForAsyncTask(this);
71
75
  const asyncManager = new AsyncManager(this);
72
76
  if (typeof asyncManager.runWebLoop === 'function') {
@@ -82,7 +86,7 @@ export class WebAsyncManagerTask extends WebSGTask {
82
86
 
83
87
  runTaskScoped<T>(callback: () => T): T {
84
88
  if (this.taskAA) {
85
- return runWithGlobalAA(this.taskAA, callback);
89
+ return webGlobals.hs_runWithGlobalAA(this.taskAA, callback);
86
90
  }
87
91
  return callback();
88
92
  }