@trackunit/iris-app-runtime-core 1.0.5 → 1.0.9

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/index.cjs.js CHANGED
@@ -426,8 +426,7 @@ const RestRuntime = {
426
426
 
427
427
  const RouterRuntime = {
428
428
  getBasePath: () => {
429
- var _a;
430
- return `${((_a = document.getElementById("baseHref")) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "<missing baseHref>"}${global.module}`;
429
+ return `${document.getElementById("baseHref")?.getAttribute("href") || "<missing baseHref>"}${global.module}`;
431
430
  },
432
431
  };
433
432
 
@@ -447,17 +446,16 @@ const ThemeCssRuntime = {
447
446
 
448
447
  const ToastRuntime = {
449
448
  async addToast(toast) {
450
- var _a, _b, _c, _d;
451
449
  const api = await getHostConnector();
452
450
  const response = await api.addToast({
453
451
  ...toast,
454
- primaryAction: (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.label,
455
- secondaryAction: (_b = toast.secondaryAction) === null || _b === void 0 ? void 0 : _b.label,
452
+ primaryAction: toast.primaryAction?.label,
453
+ secondaryAction: toast.secondaryAction?.label,
456
454
  });
457
455
  switch (response) {
458
456
  case "primaryAction":
459
457
  case "secondaryAction":
460
- (_d = (_c = toast[response]) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.call(_c);
458
+ toast[response]?.onClick?.();
461
459
  break;
462
460
  }
463
461
  },
package/index.esm.js CHANGED
@@ -424,8 +424,7 @@ const RestRuntime = {
424
424
 
425
425
  const RouterRuntime = {
426
426
  getBasePath: () => {
427
- var _a;
428
- return `${((_a = document.getElementById("baseHref")) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "<missing baseHref>"}${global.module}`;
427
+ return `${document.getElementById("baseHref")?.getAttribute("href") || "<missing baseHref>"}${global.module}`;
429
428
  },
430
429
  };
431
430
 
@@ -445,17 +444,16 @@ const ThemeCssRuntime = {
445
444
 
446
445
  const ToastRuntime = {
447
446
  async addToast(toast) {
448
- var _a, _b, _c, _d;
449
447
  const api = await getHostConnector();
450
448
  const response = await api.addToast({
451
449
  ...toast,
452
- primaryAction: (_a = toast.primaryAction) === null || _a === void 0 ? void 0 : _a.label,
453
- secondaryAction: (_b = toast.secondaryAction) === null || _b === void 0 ? void 0 : _b.label,
450
+ primaryAction: toast.primaryAction?.label,
451
+ secondaryAction: toast.secondaryAction?.label,
454
452
  });
455
453
  switch (response) {
456
454
  case "primaryAction":
457
455
  case "secondaryAction":
458
- (_d = (_c = toast[response]) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.call(_c);
456
+ toast[response]?.onClick?.();
459
457
  break;
460
458
  }
461
459
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.9",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "penpal": "^6.2.2",
11
11
  "jest-fetch-mock": "^3.0.3",
12
- "@trackunit/react-core-contexts-api": "^1.0.5",
13
- "@trackunit/iris-app-runtime-core-api": "^1.0.5"
12
+ "@trackunit/react-core-contexts-api": "1.0.9",
13
+ "@trackunit/iris-app-runtime-core-api": "1.0.9"
14
14
  },
15
15
  "module": "./index.esm.js",
16
16
  "main": "./index.cjs.js",