@auxilium/datalynk-client 1.3.19 → 1.3.20

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/index.cjs CHANGED
@@ -2345,37 +2345,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2345
2345
  __publicField(this, "nativeInstallPrompt", null);
2346
2346
  /** Resolved icon URL used for prompt + manifest */
2347
2347
  __publicField(this, "resolvedIconUrl", "https://datalynk-client.primary.auxilium.world/logo.png");
2348
- /** Resolved manifest icons (prefer true 192/512 PNG data URLs) */
2349
- __publicField(this, "resolvedManifestIcons", []);
2350
- __publicField(this, "createSizedPng", async (url, size) => {
2351
- if (this.headless || !url) return null;
2352
- try {
2353
- const img = await new Promise((res, rej) => {
2354
- const el = new Image();
2355
- const t = setTimeout(() => rej(new Error("icon-timeout")), 3500);
2356
- el.crossOrigin = "anonymous";
2357
- el.onload = () => {
2358
- clearTimeout(t);
2359
- res(el);
2360
- };
2361
- el.onerror = () => {
2362
- clearTimeout(t);
2363
- rej(new Error("icon-load-failed"));
2364
- };
2365
- el.src = url;
2366
- });
2367
- const canvas = document.createElement("canvas");
2368
- canvas.width = size;
2369
- canvas.height = size;
2370
- const ctx = canvas.getContext("2d");
2371
- if (!ctx) return null;
2372
- ctx.clearRect(0, 0, size, size);
2373
- ctx.drawImage(img, 0, 0, size, size);
2374
- return canvas.toDataURL("image/png");
2375
- } catch {
2376
- return null;
2377
- }
2378
- });
2379
2348
  this.api = api;
2380
2349
  }
2381
2350
  get headless() {
@@ -2473,22 +2442,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2473
2442
  if (!ok) iconUrl = defaultIcon;
2474
2443
  }
2475
2444
  this.resolvedIconUrl = iconUrl;
2476
- let icon192 = await this.createSizedPng(this.resolvedIconUrl, 192);
2477
- let icon512 = await this.createSizedPng(this.resolvedIconUrl, 512);
2478
- if ((!icon192 || !icon512) && this.resolvedIconUrl !== defaultIcon) {
2479
- this.resolvedIconUrl = defaultIcon;
2480
- icon192 = await this.createSizedPng(this.resolvedIconUrl, 192);
2481
- icon512 = await this.createSizedPng(this.resolvedIconUrl, 512);
2482
- }
2483
- this.resolvedManifestIcons = icon192 && icon512 ? [
2484
- { src: icon192, sizes: "192x192", type: "image/png", purpose: "any" },
2485
- { src: icon512, sizes: "512x512", type: "image/png", purpose: "any" },
2486
- { src: icon512, sizes: "512x512", type: "image/png", purpose: "maskable" }
2487
- ] : [
2488
- { src: this.resolvedIconUrl, sizes: "192x192", type: "image/png", purpose: "any" },
2489
- { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "any" },
2490
- { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "maskable" }
2491
- ];
2492
2445
  const meta = (key, name, value) => {
2493
2446
  const exists = document.querySelector(`meta[${key}="${name}"]`);
2494
2447
  if (value === void 0 || exists) return exists;
@@ -2521,7 +2474,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2521
2474
  ...manifest || {}
2522
2475
  };
2523
2476
  if (!((_c = manifestObj.icons) == null ? void 0 : _c.length)) {
2524
- manifestObj.icons = this.resolvedManifestIcons;
2477
+ manifestObj.icons = [
2478
+ { src: this.resolvedIconUrl, sizes: "192x192", type: "image/png", purpose: "any" },
2479
+ { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "any" },
2480
+ { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "maskable" }
2481
+ ];
2525
2482
  }
2526
2483
  link.href = `${base}/manifest?json=${encodeURIComponent(JSON.stringify(manifestObj))}`;
2527
2484
  if (!((_d = this.api.options.pwaSettings) == null ? void 0 : _d.hidePWAPrompt) && !this.headless && !this.iframe && !this.pwa && this.platform != "mac") {
@@ -3812,7 +3769,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3812
3769
  } });
3813
3770
  }
3814
3771
  }
3815
- const version = "1.3.19";
3772
+ const version = "1.3.20";
3816
3773
  class WebRtc {
3817
3774
  constructor(api) {
3818
3775
  __publicField(this, "ice");
package/dist/index.mjs CHANGED
@@ -2341,37 +2341,6 @@ class PWA {
2341
2341
  __publicField(this, "nativeInstallPrompt", null);
2342
2342
  /** Resolved icon URL used for prompt + manifest */
2343
2343
  __publicField(this, "resolvedIconUrl", "https://datalynk-client.primary.auxilium.world/logo.png");
2344
- /** Resolved manifest icons (prefer true 192/512 PNG data URLs) */
2345
- __publicField(this, "resolvedManifestIcons", []);
2346
- __publicField(this, "createSizedPng", async (url, size) => {
2347
- if (this.headless || !url) return null;
2348
- try {
2349
- const img = await new Promise((res, rej) => {
2350
- const el = new Image();
2351
- const t = setTimeout(() => rej(new Error("icon-timeout")), 3500);
2352
- el.crossOrigin = "anonymous";
2353
- el.onload = () => {
2354
- clearTimeout(t);
2355
- res(el);
2356
- };
2357
- el.onerror = () => {
2358
- clearTimeout(t);
2359
- rej(new Error("icon-load-failed"));
2360
- };
2361
- el.src = url;
2362
- });
2363
- const canvas = document.createElement("canvas");
2364
- canvas.width = size;
2365
- canvas.height = size;
2366
- const ctx = canvas.getContext("2d");
2367
- if (!ctx) return null;
2368
- ctx.clearRect(0, 0, size, size);
2369
- ctx.drawImage(img, 0, 0, size, size);
2370
- return canvas.toDataURL("image/png");
2371
- } catch {
2372
- return null;
2373
- }
2374
- });
2375
2344
  this.api = api;
2376
2345
  }
2377
2346
  get headless() {
@@ -2469,22 +2438,6 @@ class PWA {
2469
2438
  if (!ok) iconUrl = defaultIcon;
2470
2439
  }
2471
2440
  this.resolvedIconUrl = iconUrl;
2472
- let icon192 = await this.createSizedPng(this.resolvedIconUrl, 192);
2473
- let icon512 = await this.createSizedPng(this.resolvedIconUrl, 512);
2474
- if ((!icon192 || !icon512) && this.resolvedIconUrl !== defaultIcon) {
2475
- this.resolvedIconUrl = defaultIcon;
2476
- icon192 = await this.createSizedPng(this.resolvedIconUrl, 192);
2477
- icon512 = await this.createSizedPng(this.resolvedIconUrl, 512);
2478
- }
2479
- this.resolvedManifestIcons = icon192 && icon512 ? [
2480
- { src: icon192, sizes: "192x192", type: "image/png", purpose: "any" },
2481
- { src: icon512, sizes: "512x512", type: "image/png", purpose: "any" },
2482
- { src: icon512, sizes: "512x512", type: "image/png", purpose: "maskable" }
2483
- ] : [
2484
- { src: this.resolvedIconUrl, sizes: "192x192", type: "image/png", purpose: "any" },
2485
- { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "any" },
2486
- { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "maskable" }
2487
- ];
2488
2441
  const meta = (key, name, value) => {
2489
2442
  const exists = document.querySelector(`meta[${key}="${name}"]`);
2490
2443
  if (value === void 0 || exists) return exists;
@@ -2517,7 +2470,11 @@ class PWA {
2517
2470
  ...manifest || {}
2518
2471
  };
2519
2472
  if (!((_c = manifestObj.icons) == null ? void 0 : _c.length)) {
2520
- manifestObj.icons = this.resolvedManifestIcons;
2473
+ manifestObj.icons = [
2474
+ { src: this.resolvedIconUrl, sizes: "192x192", type: "image/png", purpose: "any" },
2475
+ { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "any" },
2476
+ { src: this.resolvedIconUrl, sizes: "512x512", type: "image/png", purpose: "maskable" }
2477
+ ];
2521
2478
  }
2522
2479
  link.href = `${base}/manifest?json=${encodeURIComponent(JSON.stringify(manifestObj))}`;
2523
2480
  if (!((_d = this.api.options.pwaSettings) == null ? void 0 : _d.hidePWAPrompt) && !this.headless && !this.iframe && !this.pwa && this.platform != "mac") {
@@ -3808,7 +3765,7 @@ class Superuser {
3808
3765
  } });
3809
3766
  }
3810
3767
  }
3811
- const version = "1.3.19";
3768
+ const version = "1.3.20";
3812
3769
  class WebRtc {
3813
3770
  constructor(api) {
3814
3771
  __publicField(this, "ice");
package/dist/pwa.d.ts CHANGED
@@ -5,8 +5,6 @@ export declare class PWA {
5
5
  nativeInstallPrompt: any;
6
6
  /** Resolved icon URL used for prompt + manifest */
7
7
  private resolvedIconUrl;
8
- /** Resolved manifest icons (prefer true 192/512 PNG data URLs) */
9
- private resolvedManifestIcons;
10
8
  get headless(): boolean;
11
9
  get iframe(): boolean;
12
10
  get mobile(): boolean;
@@ -15,7 +13,6 @@ export declare class PWA {
15
13
  get pwa(): boolean;
16
14
  constructor(api: Api);
17
15
  private bindInstallButton;
18
- private createSizedPng;
19
16
  /** Setup the PWA */
20
17
  setup(manifest?: any): Promise<void>;
21
18
  /** Prompt user to install the app */
package/dist/pwa.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,qBAAa,GAAG;IAyCH,OAAO,CAAC,QAAQ,CAAC,GAAG;IAxChC,4BAA4B;IACrB,mBAAmB,EAAE,GAAG,CAAQ;IAEvC,mDAAmD;IACnD,OAAO,CAAC,eAAe,CAAqE;IAE5F,kEAAkE;IAClE,OAAO,CAAC,qBAAqB,CAAa;IAE1C,IAAI,QAAQ,IAAI,OAAO,CAAyC;IAEhE,IAAI,MAAM,IAAI,OAAO,CAAyC;IAE9D,IAAI,MAAM,IAAI,OAAO,CAAuD;IAE5E,IAAI,QAAQ,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAQ1E;IAED,IAAI,OAAO,IAAI,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CASxF;IAED,IAAI,GAAG,IAAI,OAAO,CAEjB;gBAE4B,GAAG,EAAE,GAAG;IAErC,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,cAAc,CA0BrB;IAED,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IAiJ9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAyLzC"}
1
+ {"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,qBAAa,GAAG;IAsCH,OAAO,CAAC,QAAQ,CAAC,GAAG;IArChC,4BAA4B;IACrB,mBAAmB,EAAE,GAAG,CAAQ;IAEvC,mDAAmD;IACnD,OAAO,CAAC,eAAe,CAAqE;IAE5F,IAAI,QAAQ,IAAI,OAAO,CAAyC;IAEhE,IAAI,MAAM,IAAI,OAAO,CAAyC;IAE9D,IAAI,MAAM,IAAI,OAAO,CAAuD;IAE5E,IAAI,QAAQ,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAQ1E;IAED,IAAI,OAAO,IAAI,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CASxF;IAED,IAAI,GAAG,IAAI,OAAO,CAEjB;gBAE4B,GAAG,EAAE,GAAG;IAErC,OAAO,CAAC,iBAAiB;IAiBzB,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IA8H9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAyLzC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@auxilium/datalynk-client",
3
3
  "description": "Datalynk client library",
4
4
  "repository": "https://gitlab.auxiliumgroup.com/auxilium/datalynk/datalynk-client",
5
- "version": "1.3.19",
5
+ "version": "1.3.20",
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
7
7
  "private": false,
8
8
  "main": "./dist/index.cjs",