@auxilium/datalynk-client 1.2.92 → 1.3.0

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/api.d.ts CHANGED
@@ -54,6 +54,15 @@ export type ApiOptions = {
54
54
  /** TURN server password */
55
55
  password?: string;
56
56
  };
57
+ /** Progressive Web App settings */
58
+ pwaSettings?: {
59
+ /** How long to wait before showing install prompt (seconds). Default is 30 seconds */
60
+ timeout?: number;
61
+ /** Days until dismissed prompt can show again. If set to 0 it will trigger every refresh. (Default is 7 days) */
62
+ dismissExpiry?: number;
63
+ /** Show PWA install link on login screen. Default is False */
64
+ loginLink?: boolean;
65
+ };
57
66
  };
58
67
  /**
59
68
  * Possible options for API calls
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAC,eAAe,EAAuB,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAA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;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IA0B9B;;;;OAIG;IACI,KAAK,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE;IAehD;;;;OAIG;IACI,QAAQ,CAAC,OAAO,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC;IAiB7C;;;;;;OAMG;IACI,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAU7E;;;;;;;;;;;OAWG;IACI,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAqC/E;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;CAIjE"}
package/dist/index.js CHANGED
@@ -1755,6 +1755,7 @@ const _LoginPrompt = class _LoginPrompt {
1755
1755
  this.themeDefaults().then(() => this.render());
1756
1756
  }
1757
1757
  async render() {
1758
+ var _a;
1758
1759
  this.close();
1759
1760
  document.head.innerHTML += _LoginPrompt.css(this.options);
1760
1761
  const div = document.createElement("div");
@@ -1768,6 +1769,24 @@ const _LoginPrompt = class _LoginPrompt {
1768
1769
  this.username = document.querySelector('#datalynk-login-form input[name="username"]');
1769
1770
  if (this.options.persist === false) this.persist.parentElement.remove();
1770
1771
  this.form.onsubmit = (event) => this.login(event);
1772
+ const pwaLink = document.querySelector("#pwa-install-link");
1773
+ const isApple = /iPad|iPhone|iPod|macintosh|mac os x/i.test(navigator.userAgent);
1774
+ if (pwaLink && ((_a = this.api.options.pwaSettings) == null ? void 0 : _a.loginLink) && !isApple) {
1775
+ pwaLink.classList.remove("hidden");
1776
+ pwaLink.addEventListener("click", async (e) => {
1777
+ e.preventDefault();
1778
+ if (this.api.pwa["deferredPrompt"]) {
1779
+ this.api.pwa["deferredPrompt"].prompt();
1780
+ const choice = await this.api.pwa["deferredPrompt"].userChoice;
1781
+ if (choice.outcome === "accepted") {
1782
+ console.log("PWA installed via login link");
1783
+ }
1784
+ this.api.pwa["deferredPrompt"] = null;
1785
+ } else {
1786
+ this.api.pwa.prompt();
1787
+ }
1788
+ });
1789
+ }
1771
1790
  }
1772
1791
  async themeDefaults() {
1773
1792
  const theme = await getTheme(this.spoke, "login");
@@ -1966,7 +1985,17 @@ __publicField(_LoginPrompt, "css", (options) => `
1966
1985
  #datalynk-login .login-links a {
1967
1986
  text-decoration: none;
1968
1987
  }
1969
-
1988
+
1989
+ #datalynk-login #pwa-install-link {
1990
+ display: inline-flex;
1991
+ align-items: center;
1992
+ gap: 0.4rem; /* space between icon and text */
1993
+ font-size: 16px;
1994
+ text-decoration: none;
1995
+ color: var(--theme-text);
1996
+ text-shadow: 0 0 10px black;
1997
+ }
1998
+
1970
1999
  #datalynk-login .login-links img {
1971
2000
  width: 150px;
1972
2001
  height: auto;
@@ -1991,11 +2020,7 @@ __publicField(_LoginPrompt, "css", (options) => `
1991
2020
  /** Dynamically create HTML */
1992
2021
  __publicField(_LoginPrompt, "template", (options) => `
1993
2022
  <div id="datalynk-login">
1994
- <!-- Used to check if image is valid -->
1995
- ${!options.backgroundColor ? `
1996
- <img src="${options.background}" onerror="document.querySelector('#datalynk-login').style.backgroundImage = 'url(https://datalynk.auxiliumgroup.com/static/js/auxilium/dijits/templates/login/datalynk/background.jpg)'" style="width: 0; height: 0;"/>
1997
- ` : ""}
1998
-
2023
+ ${!options.backgroundColor ? `<img src="${options.background}" onerror="document.querySelector('#datalynk-login').style.backgroundImage = 'url(https://datalynk.auxiliumgroup.com/static/js/auxilium/dijits/templates/login/datalynk/background.jpg)'" style="width: 0; height: 0;"/>` : ""}
1999
2024
  <div class="added-links">
2000
2025
  ${(options.addLinks || []).map((link) => `<a href="${link.url || "#"}" target="_blank">${link.text}</a>`).join(" | ")}
2001
2026
  </div>
@@ -2027,16 +2052,20 @@ __publicField(_LoginPrompt, "template", (options) => `
2027
2052
  <button type="submit">Login</button>
2028
2053
  </form>
2029
2054
  </div>
2030
- ${options.hideApps ? "" : `
2031
2055
  <div class="login-links" style="text-align: center">
2056
+ <a href="#" id="pwa-install-link" class="hidden" style="margin-right: 1rem;" title="Install App">
2057
+ <svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 0 24 24" width="40px" fill="${options.color || "#0B76FC"}">
2058
+ <path d="M12 16l4-5h-3V4h-2v7H8z"/><path d="M20 18H4v-2h16v2z"/>
2059
+ </svg> Download App
2060
+ </a>
2061
+ ${options.hideApps ? "" : `
2032
2062
  <a href="https://itunes.apple.com/ca/app/auxilium-mobile/id1166379280?mt=8" target="_blank">
2033
2063
  <img alt="App Store" src="https://datalynk.auxiliumgroup.com/api/js/auxilium/dijits/templates/login/_common/mobile_apple_transparent.png">
2034
2064
  </a>
2035
2065
  <a href="https://play.google.com/store/apps/details?id=com.auxilium.auxiliummobilesolutions&amp;hl=en" target="_blank">
2036
2066
  <img alt="Playstore" src="https://datalynk.auxiliumgroup.com/api/js/auxilium/dijits/templates/login/_common/mobile_google_transparent.png">
2037
- </a>
2067
+ </a>`}
2038
2068
  </div>
2039
- `}
2040
2069
  </div>
2041
2070
  <div class="login-footer" style="position: relative; display: flex; align-items: center; justify-content: center;">
2042
2071
  <div class="sloped-div"></div>
@@ -2258,10 +2287,6 @@ class PWA {
2258
2287
  constructor(api) {
2259
2288
  __publicField(this, "deferredPrompt", null);
2260
2289
  this.api = api;
2261
- window.addEventListener("beforeinstallprompt", (e) => {
2262
- e.preventDefault();
2263
- this.deferredPrompt = e;
2264
- });
2265
2290
  }
2266
2291
  // Holds the beforeinstallprompt event
2267
2292
  get iframe() {
@@ -2282,8 +2307,40 @@ class PWA {
2282
2307
  get pwa() {
2283
2308
  return matchMedia("(display-mode: standalone)").matches || (navigator == null ? void 0 : navigator.standalone) || document.referrer.includes("android-app://");
2284
2309
  }
2310
+ bindInstallButton() {
2311
+ const installBtn = document.querySelector("#installPwaBtn");
2312
+ if (!installBtn) return;
2313
+ installBtn.onclick = async () => {
2314
+ var _a;
2315
+ this.deferredPrompt.prompt();
2316
+ const choice = await this.deferredPrompt.userChoice;
2317
+ if (choice.outcome === "accepted") {
2318
+ console.log("PWA installed");
2319
+ localStorage.removeItem(`${this.api.options.name}:pwa`);
2320
+ }
2321
+ this.deferredPrompt = null;
2322
+ (_a = document.querySelector(".pwa-prompt")) == null ? void 0 : _a.remove();
2323
+ };
2324
+ }
2285
2325
  /** Setup the PWA */
2286
2326
  async setup(manifest = {}) {
2327
+ var _a, _b, _c;
2328
+ window.addEventListener("beforeinstallprompt", (e) => {
2329
+ e.preventDefault();
2330
+ this.deferredPrompt = e;
2331
+ const actions = document.querySelector(".pwa-prompt-actions");
2332
+ if (actions && !actions.querySelector("#installPwaBtn")) {
2333
+ actions.innerHTML = `<button id="installPwaBtn">Install App</button>`;
2334
+ this.bindInstallButton();
2335
+ }
2336
+ });
2337
+ const settings = {
2338
+ timeout: (((_a = this.api.options.pwaSettings) == null ? void 0 : _a.timeout) ?? 30) * 1e3,
2339
+ // default 30s
2340
+ dismissExpiry: ((_b = this.api.options.pwaSettings) == null ? void 0 : _b.dismissExpiry) ?? 7,
2341
+ // default 7 days
2342
+ loginLink: ((_c = this.api.options.pwaSettings) == null ? void 0 : _c.loginLink) ?? false
2343
+ };
2287
2344
  const meta = (key, name, value) => {
2288
2345
  const exists = document.querySelector(`meta[${key}="${name}"]`);
2289
2346
  if (value === void 0 || exists) return exists;
@@ -2310,12 +2367,19 @@ class PWA {
2310
2367
  document.head.append(link);
2311
2368
  }
2312
2369
  if (!this.iframe && !this.pwa && this.platform != "mac") setTimeout(() => {
2313
- const dismissed = !!localStorage.getItem(`${this.api.options.name}:pwa`);
2314
- if (!dismissed) this.prompt();
2315
- }, 1e4);
2370
+ const dismissedDate = localStorage.getItem(`${this.api.options.name}:pwa`);
2371
+ if (settings.dismissExpiry > 0 && dismissedDate) {
2372
+ const diffDays = (Date.now() - new Date(dismissedDate).getTime()) / (1e3 * 60 * 60 * 24);
2373
+ if (diffDays < settings.dismissExpiry) return;
2374
+ } else if (settings.dismissExpiry === 0) {
2375
+ localStorage.removeItem(`${this.api.options.name}:pwa`);
2376
+ }
2377
+ this.prompt();
2378
+ }, settings.timeout);
2316
2379
  }
2317
2380
  /** Prompt user to install the app */
2318
2381
  async prompt(platform) {
2382
+ var _a;
2319
2383
  if (document.querySelector(".pwa-prompt")) return;
2320
2384
  const android = (platform || this.platform) == "android";
2321
2385
  let style = document.querySelector("style.pwa");
@@ -2323,129 +2387,122 @@ class PWA {
2323
2387
  style = document.createElement("style");
2324
2388
  style.classList.add("pwa");
2325
2389
  style.innerHTML = `
2326
- .pwa-prompt-backdrop {
2327
- position: fixed;
2328
- display: relative;
2329
- left: 0;
2330
- top: 0;
2331
- right: 0;
2332
- bottom: 0;
2333
- background: rgba(0,0,0,.5);
2334
- z-index: 9999;
2335
- animation: fadeIn 0.5s ease-in-out forwards;
2336
- opacity: 0;
2337
- }
2338
- .pwa-prompt-backdrop.exit {
2339
- animation: fadeOut 0.5s ease-in-out forwards !important;
2340
- }
2341
- .pwa-prompt {
2342
- position: fixed;
2343
- background: #fff;
2344
- color: black;
2345
- bottom: 0;
2346
- left: 50%;
2347
- width: min(100vw, 450px);
2348
- transform: translate(-50%, 0);
2349
- animation: slideUp 0.5s ease-in-out forwards;
2350
- }
2351
- .pwa-prompt.exit {
2352
- animation: slideDown 0.5s ease-in-out forwards !important;
2353
- }
2354
- .pwa-prompt img {
2355
- width: 18px;
2356
- height: 18px;
2357
- }
2358
- .pwa-prompt h1 {
2359
- font-size: 1.25rem;
2360
- font-weight: bold;
2361
- }
2362
- .pwa-prompt-close {
2363
- position: absolute;
2364
- right: 5px;
2365
- top: 10px;
2366
- background: transparent;
2367
- border: none;
2368
- cursor: pointer;
2369
- }
2370
-
2371
- @keyframes fadeIn {
2372
- from { opacity: 0; }
2373
- to { opacity: 1; }
2374
- }
2375
- @keyframes fadeOut {
2376
- from { opacity: 1; }
2377
- to { opacity: 0; }
2378
- }
2379
-
2380
- @keyframes slideUp {
2381
- from { transform: translate(-50%, 100%); }
2382
- to { transform: translate(-50%, 0); }
2383
- }
2384
- @keyframes slideDown {
2385
- from { transform: translate(-50%, 0); }
2386
- to { transform: translate(-50%, 100%); }
2387
- }
2388
- `;
2390
+ .pwa-prompt {
2391
+ position: fixed;
2392
+ bottom: 0;
2393
+ left: 50%;
2394
+ transform: translateX(-50%);
2395
+ background: #fff;
2396
+ color: #222;
2397
+ width: min(100vw, 450px);
2398
+ border-radius: 8px 8px 0 0;
2399
+ box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
2400
+ font-family: system-ui, sans-serif;
2401
+ animation: slideUp 0.35s ease forwards;
2402
+ z-index: 10000;
2403
+ box-shadow: 0px 10px 5px 3px #0000007d;
2404
+ }
2405
+ .pwa-prompt-header {
2406
+ display: flex;
2407
+ align-items: center;
2408
+ background: linear-gradient(140deg, #080808, #454242bf);
2409
+ color: #fff;
2410
+ padding: 0.75rem 1rem;
2411
+ position: relative;
2412
+ border-radius: 10px 10px 0px 0px;
2413
+ }
2414
+ .pwa-prompt-header img {
2415
+ height: 28px;
2416
+ margin-right: 0.5rem;
2417
+ }
2418
+ .pwa-prompt-header h1 {
2419
+ font-size: 1rem;
2420
+ margin: 0;
2421
+ flex-grow: 1;
2422
+ }
2423
+ .pwa-prompt-close {
2424
+ position: absolute;
2425
+ right: 12px;
2426
+ top: 10px;
2427
+ background: transparent;
2428
+ border: none;
2429
+ color: #fff;
2430
+ font-size: 18px;
2431
+ cursor: pointer;
2432
+ }
2433
+ .pwa-prompt-body {
2434
+ padding: 1rem;
2435
+ font-size: 0.9rem;
2436
+ text-align: center;
2437
+ }
2438
+ .pwa-prompt-actions {
2439
+ text-align: center;
2440
+ padding: 0.75rem 1rem 1rem;
2441
+ }
2442
+ .pwa-prompt-actions button {
2443
+ background: #c33031;
2444
+ color: #fff;
2445
+ border: none;
2446
+ padding: 0.6rem 1.2rem;
2447
+ border-radius: 6px;
2448
+ cursor: pointer;
2449
+ font-size: 0.9rem;
2450
+ }
2451
+ .pwa-steps ol {
2452
+ padding-left: 1.25rem;
2453
+ text-align: left;
2454
+ }
2455
+ .pwa-prompt-actions table {
2456
+ width: 100%;
2457
+ margin: 0;
2458
+ }
2459
+ .pwa-prompt-actions td {
2460
+ padding: 0.5rem;
2461
+ }
2462
+ @keyframes slideUp {
2463
+ from { transform: translate(-50%, 100%); opacity: 0; }
2464
+ to { transform: translate(-50%, 0); opacity: 1; }
2465
+ }`;
2389
2466
  document.head.append(style);
2390
2467
  }
2391
- const backdrop = document.createElement("div");
2392
- backdrop.classList.add("pwa-prompt-backdrop");
2393
2468
  const prompt = document.createElement("div");
2394
2469
  prompt.classList.add("pwa-prompt");
2395
2470
  prompt.innerHTML = `
2396
- <div style="display: flex; padding: 1rem; align-items: center">
2397
- <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" style="height: 40px; width: auto; margin-right: .5rem;" />
2398
- <h1 style="margin: 0">Install ${this.api.options.name}</h1>
2471
+ <div class="pwa-prompt-header">
2472
+ <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" />
2473
+ <h1>Install ${this.api.options.name}</h1>
2474
+ <button class="pwa-prompt-close">&times;</button>
2475
+ </div>
2476
+ <div class="pwa-prompt-body">
2477
+ ${this.deferredPrompt ? "Click below to install the app directly to your device." : "Add this app to your home screen for a faster, fullscreen experience."}
2478
+ </div>
2479
+ <div class="pwa-prompt-actions">
2480
+ ${this.deferredPrompt ? `<button id="installPwaBtn">Install App</button>` : `
2481
+ <table>
2482
+ <tr>
2483
+ <td style="width:40px;text-align:center">
2484
+ ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(1.5)"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>' : '<svg viewBox="0 0 566 670" xmlns="http://www.w3.org/2000/svg" fill="#c33031" height="40px"><path d="M255 12c4-4 10-8 16-8s12 3 16 8l94 89c3 4 6 7 8 12 2 6 0 14-5 19-7 8-20 9-28 2l-7-7-57-60 2 54v276c0 12-10 22-22 22-12 1-24-10-23-22V110l1-43-60 65c-5 5-13 8-21 6a19 19 0 0 1-16-17c-1-7 2-13 7-18l95-91z" /><path d="M43 207c16-17 40-23 63-23h83v46h-79c-12 0-25 3-33 13-8 9-10 21-10 33v260c0 13 0 27 6 38 5 12 18 18 30 19l14 1h302c14 0 28 0 40-8 11-7 16-21 16-34V276c0-11-2-24-9-33-8-10-22-13-34-13h-78v-46h75c13 0 25 1 37 4 16 4 31 13 41 27 11 17 14 37 14 57v280c0 20-3 41-15 58a71 71 0 0 1-45 27c-11 2-23 3-34 3H109c-19-1-40-4-56-15-14-9-23-23-27-38-4-12-5-25-5-38V270c1-22 6-47 22-63z" /></svg>'}
2485
+ </td>
2486
+ <td>1) ${android ? "Open the dropdown menu" : 'Tap the "Share" button'}</td>
2487
+ </tr>
2488
+ <tr>
2489
+ <td style="width:40px;text-align:center">
2490
+ ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(-1.5, 1.5)"><path d="M280-40q-33 0-56.5-23.5T200-120v-720q0-33 23.5-56.5T280-920h280v80H280v40h280v80H280v480h400v-80h80v200q0 33-23.5 56.5T680-40H280Zm0-120v40h400v-40H280Zm440-240L520-600l56-56 104 104v-288h80v288l104-104 56 56-200 200ZM280-800v-40 40Zm0 640v40-40Z"/></svg>' : '<svg viewBox="0 0 578 584" xmlns="http://www.w3.org/2000/svg" fill="black" height="34px"><path d="M101 35l19-1h333c12 0 23 0 35 3 17 3 34 12 44 27 13 16 16 38 16 58v329c0 19 0 39-8 57a65 65 0 0 1-37 37c-18 7-38 7-57 7H130c-21 1-44 0-63-10-14-7-25-20-30-34-6-15-8-30-8-45V121c1-21 5-44 19-61 13-16 33-23 53-25m7 46c-10 1-19 6-24 14-7 8-9 20-9 31v334c0 12 2 25 10 34 9 10 23 12 35 12h336c14 1 30-3 38-15 6-9 8-20 8-31V125c0-12-2-24-10-33-9-9-22-12-35-12H121l-13 1z" /><path d="M271 161c9-11 31-10 38 4 3 5 3 11 3 17v87h88c7 0 16 1 21 7 6 6 7 14 6 22a21 21 0 0 1-10 14c-5 4-11 5-17 5h-88v82c0 7-1 15-6 20-10 10-29 10-37-2-3-6-4-13-4-19v-81h-87c-8-1-17-3-23-9-5-6-6-15-4-22a21 21 0 0 1 11-14c6-3 13-3 19-3h84v-88c0-7 1-14 6-20z" /></svg>'}
2491
+ </td>
2492
+ <td>2) Select "Add to Home Screen"</td>
2493
+ </tr>
2494
+ </table>
2495
+ `}
2399
2496
  </div>
2400
- <div style="display: flex; flex-direction: column; align-items: center">
2401
- <div style="border-top: 2px solid #00000020; border-bottom: 2px solid #00000020; padding: 0 1rem">
2402
- <p style="margin-top: 1rem; text-align: center">
2403
- ${this.deferredPrompt ? "Click the button below to install the app directly to your device." : "This website can be installed as an App! Add it to your home screen for quick access & fullscreen use."}
2404
- </p>
2405
- </div>
2406
- ${this.deferredPrompt ? `<button id="installPwaBtn" style="background:#0B76FC;color:white;border:none;padding:.5rem 1rem;border-radius:5px;cursor:pointer;margin:1rem 0">Install</button>` : `
2407
- <table style="margin: 1.5rem 0">
2408
- <tr>
2409
- <td style="width: 50px; text-align: center">
2410
- ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(1.5)">...</svg>' : '<svg viewBox="0 0 566 670" xmlns="http://www.w3.org/2000/svg" fill="#0B76FC" height="40px">...</svg>'}
2411
- </td>
2412
- <td><p style="margin: 1rem 0">1) ${android ? "Open the dropdown menu" : 'Press the "Share" button'}</p></td>
2413
- </tr>
2414
- <tr>
2415
- <td style="width: 50px; text-align: center">
2416
- ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">...</svg>' : '<svg viewBox="0 0 578 584" xmlns="http://www.w3.org/2000/svg" fill="black" height="34px">...</svg>'}
2417
- </td>
2418
- <td><p style="margin: 1rem 0">2) Press "Add to Home Screen"</p></td>
2419
- </tr>
2420
- </table>`}
2421
- </div>`;
2422
- const close = document.createElement("button");
2423
- close.classList.add("pwa-prompt-close");
2424
- close.innerText = "x";
2425
- close.onclick = () => {
2426
- prompt.classList.add("exit");
2427
- backdrop.classList.add("exit");
2428
- localStorage.setItem(`${this.api.options.name}:pwa`, "dismissed");
2429
- setTimeout(() => {
2430
- prompt.remove();
2431
- backdrop.remove();
2432
- }, 500);
2497
+ `;
2498
+ const closeBtn = prompt.querySelector(".pwa-prompt-close");
2499
+ const dismissExpiry = ((_a = this.api.options.pwaSettings) == null ? void 0 : _a.dismissExpiry) ?? 7;
2500
+ closeBtn.onclick = () => {
2501
+ dismissExpiry > 0 ? localStorage.setItem(`${this.api.options.name}:pwa`, (/* @__PURE__ */ new Date()).toISOString()) : localStorage.removeItem(`${this.api.options.name}:pwa`);
2502
+ prompt.remove();
2433
2503
  };
2434
- prompt.append(close);
2435
- backdrop.append(prompt);
2436
- document.body.append(backdrop);
2437
- if (this.deferredPrompt) {
2438
- const installBtn = prompt.querySelector("#installPwaBtn");
2439
- if (installBtn) {
2440
- installBtn.onclick = async () => {
2441
- this.deferredPrompt.prompt();
2442
- const choice = await this.deferredPrompt.userChoice;
2443
- if (choice.outcome === "accepted") console.log("PWA installed");
2444
- this.deferredPrompt = null;
2445
- close.click();
2446
- };
2447
- }
2448
- }
2504
+ document.body.append(prompt);
2505
+ if (this.deferredPrompt) this.bindInstallButton();
2449
2506
  }
2450
2507
  }
2451
2508
  class Files {
@@ -3371,7 +3428,7 @@ class Superuser {
3371
3428
  } });
3372
3429
  }
3373
3430
  }
3374
- const version = "1.2.92";
3431
+ const version = "1.3.0";
3375
3432
  class WebRtc {
3376
3433
  constructor(api) {
3377
3434
  __publicField(this, "ice");
package/dist/index.mjs CHANGED
@@ -1753,6 +1753,7 @@ const _LoginPrompt = class _LoginPrompt {
1753
1753
  this.themeDefaults().then(() => this.render());
1754
1754
  }
1755
1755
  async render() {
1756
+ var _a;
1756
1757
  this.close();
1757
1758
  document.head.innerHTML += _LoginPrompt.css(this.options);
1758
1759
  const div = document.createElement("div");
@@ -1766,6 +1767,24 @@ const _LoginPrompt = class _LoginPrompt {
1766
1767
  this.username = document.querySelector('#datalynk-login-form input[name="username"]');
1767
1768
  if (this.options.persist === false) this.persist.parentElement.remove();
1768
1769
  this.form.onsubmit = (event) => this.login(event);
1770
+ const pwaLink = document.querySelector("#pwa-install-link");
1771
+ const isApple = /iPad|iPhone|iPod|macintosh|mac os x/i.test(navigator.userAgent);
1772
+ if (pwaLink && ((_a = this.api.options.pwaSettings) == null ? void 0 : _a.loginLink) && !isApple) {
1773
+ pwaLink.classList.remove("hidden");
1774
+ pwaLink.addEventListener("click", async (e) => {
1775
+ e.preventDefault();
1776
+ if (this.api.pwa["deferredPrompt"]) {
1777
+ this.api.pwa["deferredPrompt"].prompt();
1778
+ const choice = await this.api.pwa["deferredPrompt"].userChoice;
1779
+ if (choice.outcome === "accepted") {
1780
+ console.log("PWA installed via login link");
1781
+ }
1782
+ this.api.pwa["deferredPrompt"] = null;
1783
+ } else {
1784
+ this.api.pwa.prompt();
1785
+ }
1786
+ });
1787
+ }
1769
1788
  }
1770
1789
  async themeDefaults() {
1771
1790
  const theme = await getTheme(this.spoke, "login");
@@ -1964,7 +1983,17 @@ __publicField(_LoginPrompt, "css", (options) => `
1964
1983
  #datalynk-login .login-links a {
1965
1984
  text-decoration: none;
1966
1985
  }
1967
-
1986
+
1987
+ #datalynk-login #pwa-install-link {
1988
+ display: inline-flex;
1989
+ align-items: center;
1990
+ gap: 0.4rem; /* space between icon and text */
1991
+ font-size: 16px;
1992
+ text-decoration: none;
1993
+ color: var(--theme-text);
1994
+ text-shadow: 0 0 10px black;
1995
+ }
1996
+
1968
1997
  #datalynk-login .login-links img {
1969
1998
  width: 150px;
1970
1999
  height: auto;
@@ -1989,11 +2018,7 @@ __publicField(_LoginPrompt, "css", (options) => `
1989
2018
  /** Dynamically create HTML */
1990
2019
  __publicField(_LoginPrompt, "template", (options) => `
1991
2020
  <div id="datalynk-login">
1992
- <!-- Used to check if image is valid -->
1993
- ${!options.backgroundColor ? `
1994
- <img src="${options.background}" onerror="document.querySelector('#datalynk-login').style.backgroundImage = 'url(https://datalynk.auxiliumgroup.com/static/js/auxilium/dijits/templates/login/datalynk/background.jpg)'" style="width: 0; height: 0;"/>
1995
- ` : ""}
1996
-
2021
+ ${!options.backgroundColor ? `<img src="${options.background}" onerror="document.querySelector('#datalynk-login').style.backgroundImage = 'url(https://datalynk.auxiliumgroup.com/static/js/auxilium/dijits/templates/login/datalynk/background.jpg)'" style="width: 0; height: 0;"/>` : ""}
1997
2022
  <div class="added-links">
1998
2023
  ${(options.addLinks || []).map((link) => `<a href="${link.url || "#"}" target="_blank">${link.text}</a>`).join(" | ")}
1999
2024
  </div>
@@ -2025,16 +2050,20 @@ __publicField(_LoginPrompt, "template", (options) => `
2025
2050
  <button type="submit">Login</button>
2026
2051
  </form>
2027
2052
  </div>
2028
- ${options.hideApps ? "" : `
2029
2053
  <div class="login-links" style="text-align: center">
2054
+ <a href="#" id="pwa-install-link" class="hidden" style="margin-right: 1rem;" title="Install App">
2055
+ <svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 0 24 24" width="40px" fill="${options.color || "#0B76FC"}">
2056
+ <path d="M12 16l4-5h-3V4h-2v7H8z"/><path d="M20 18H4v-2h16v2z"/>
2057
+ </svg> Download App
2058
+ </a>
2059
+ ${options.hideApps ? "" : `
2030
2060
  <a href="https://itunes.apple.com/ca/app/auxilium-mobile/id1166379280?mt=8" target="_blank">
2031
2061
  <img alt="App Store" src="https://datalynk.auxiliumgroup.com/api/js/auxilium/dijits/templates/login/_common/mobile_apple_transparent.png">
2032
2062
  </a>
2033
2063
  <a href="https://play.google.com/store/apps/details?id=com.auxilium.auxiliummobilesolutions&amp;hl=en" target="_blank">
2034
2064
  <img alt="Playstore" src="https://datalynk.auxiliumgroup.com/api/js/auxilium/dijits/templates/login/_common/mobile_google_transparent.png">
2035
- </a>
2065
+ </a>`}
2036
2066
  </div>
2037
- `}
2038
2067
  </div>
2039
2068
  <div class="login-footer" style="position: relative; display: flex; align-items: center; justify-content: center;">
2040
2069
  <div class="sloped-div"></div>
@@ -2256,10 +2285,6 @@ class PWA {
2256
2285
  constructor(api) {
2257
2286
  __publicField(this, "deferredPrompt", null);
2258
2287
  this.api = api;
2259
- window.addEventListener("beforeinstallprompt", (e) => {
2260
- e.preventDefault();
2261
- this.deferredPrompt = e;
2262
- });
2263
2288
  }
2264
2289
  // Holds the beforeinstallprompt event
2265
2290
  get iframe() {
@@ -2280,8 +2305,40 @@ class PWA {
2280
2305
  get pwa() {
2281
2306
  return matchMedia("(display-mode: standalone)").matches || (navigator == null ? void 0 : navigator.standalone) || document.referrer.includes("android-app://");
2282
2307
  }
2308
+ bindInstallButton() {
2309
+ const installBtn = document.querySelector("#installPwaBtn");
2310
+ if (!installBtn) return;
2311
+ installBtn.onclick = async () => {
2312
+ var _a;
2313
+ this.deferredPrompt.prompt();
2314
+ const choice = await this.deferredPrompt.userChoice;
2315
+ if (choice.outcome === "accepted") {
2316
+ console.log("PWA installed");
2317
+ localStorage.removeItem(`${this.api.options.name}:pwa`);
2318
+ }
2319
+ this.deferredPrompt = null;
2320
+ (_a = document.querySelector(".pwa-prompt")) == null ? void 0 : _a.remove();
2321
+ };
2322
+ }
2283
2323
  /** Setup the PWA */
2284
2324
  async setup(manifest = {}) {
2325
+ var _a, _b, _c;
2326
+ window.addEventListener("beforeinstallprompt", (e) => {
2327
+ e.preventDefault();
2328
+ this.deferredPrompt = e;
2329
+ const actions = document.querySelector(".pwa-prompt-actions");
2330
+ if (actions && !actions.querySelector("#installPwaBtn")) {
2331
+ actions.innerHTML = `<button id="installPwaBtn">Install App</button>`;
2332
+ this.bindInstallButton();
2333
+ }
2334
+ });
2335
+ const settings = {
2336
+ timeout: (((_a = this.api.options.pwaSettings) == null ? void 0 : _a.timeout) ?? 30) * 1e3,
2337
+ // default 30s
2338
+ dismissExpiry: ((_b = this.api.options.pwaSettings) == null ? void 0 : _b.dismissExpiry) ?? 7,
2339
+ // default 7 days
2340
+ loginLink: ((_c = this.api.options.pwaSettings) == null ? void 0 : _c.loginLink) ?? false
2341
+ };
2285
2342
  const meta = (key, name, value) => {
2286
2343
  const exists = document.querySelector(`meta[${key}="${name}"]`);
2287
2344
  if (value === void 0 || exists) return exists;
@@ -2308,12 +2365,19 @@ class PWA {
2308
2365
  document.head.append(link);
2309
2366
  }
2310
2367
  if (!this.iframe && !this.pwa && this.platform != "mac") setTimeout(() => {
2311
- const dismissed = !!localStorage.getItem(`${this.api.options.name}:pwa`);
2312
- if (!dismissed) this.prompt();
2313
- }, 1e4);
2368
+ const dismissedDate = localStorage.getItem(`${this.api.options.name}:pwa`);
2369
+ if (settings.dismissExpiry > 0 && dismissedDate) {
2370
+ const diffDays = (Date.now() - new Date(dismissedDate).getTime()) / (1e3 * 60 * 60 * 24);
2371
+ if (diffDays < settings.dismissExpiry) return;
2372
+ } else if (settings.dismissExpiry === 0) {
2373
+ localStorage.removeItem(`${this.api.options.name}:pwa`);
2374
+ }
2375
+ this.prompt();
2376
+ }, settings.timeout);
2314
2377
  }
2315
2378
  /** Prompt user to install the app */
2316
2379
  async prompt(platform) {
2380
+ var _a;
2317
2381
  if (document.querySelector(".pwa-prompt")) return;
2318
2382
  const android = (platform || this.platform) == "android";
2319
2383
  let style = document.querySelector("style.pwa");
@@ -2321,129 +2385,122 @@ class PWA {
2321
2385
  style = document.createElement("style");
2322
2386
  style.classList.add("pwa");
2323
2387
  style.innerHTML = `
2324
- .pwa-prompt-backdrop {
2325
- position: fixed;
2326
- display: relative;
2327
- left: 0;
2328
- top: 0;
2329
- right: 0;
2330
- bottom: 0;
2331
- background: rgba(0,0,0,.5);
2332
- z-index: 9999;
2333
- animation: fadeIn 0.5s ease-in-out forwards;
2334
- opacity: 0;
2335
- }
2336
- .pwa-prompt-backdrop.exit {
2337
- animation: fadeOut 0.5s ease-in-out forwards !important;
2338
- }
2339
- .pwa-prompt {
2340
- position: fixed;
2341
- background: #fff;
2342
- color: black;
2343
- bottom: 0;
2344
- left: 50%;
2345
- width: min(100vw, 450px);
2346
- transform: translate(-50%, 0);
2347
- animation: slideUp 0.5s ease-in-out forwards;
2348
- }
2349
- .pwa-prompt.exit {
2350
- animation: slideDown 0.5s ease-in-out forwards !important;
2351
- }
2352
- .pwa-prompt img {
2353
- width: 18px;
2354
- height: 18px;
2355
- }
2356
- .pwa-prompt h1 {
2357
- font-size: 1.25rem;
2358
- font-weight: bold;
2359
- }
2360
- .pwa-prompt-close {
2361
- position: absolute;
2362
- right: 5px;
2363
- top: 10px;
2364
- background: transparent;
2365
- border: none;
2366
- cursor: pointer;
2367
- }
2368
-
2369
- @keyframes fadeIn {
2370
- from { opacity: 0; }
2371
- to { opacity: 1; }
2372
- }
2373
- @keyframes fadeOut {
2374
- from { opacity: 1; }
2375
- to { opacity: 0; }
2376
- }
2377
-
2378
- @keyframes slideUp {
2379
- from { transform: translate(-50%, 100%); }
2380
- to { transform: translate(-50%, 0); }
2381
- }
2382
- @keyframes slideDown {
2383
- from { transform: translate(-50%, 0); }
2384
- to { transform: translate(-50%, 100%); }
2385
- }
2386
- `;
2388
+ .pwa-prompt {
2389
+ position: fixed;
2390
+ bottom: 0;
2391
+ left: 50%;
2392
+ transform: translateX(-50%);
2393
+ background: #fff;
2394
+ color: #222;
2395
+ width: min(100vw, 450px);
2396
+ border-radius: 8px 8px 0 0;
2397
+ box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
2398
+ font-family: system-ui, sans-serif;
2399
+ animation: slideUp 0.35s ease forwards;
2400
+ z-index: 10000;
2401
+ box-shadow: 0px 10px 5px 3px #0000007d;
2402
+ }
2403
+ .pwa-prompt-header {
2404
+ display: flex;
2405
+ align-items: center;
2406
+ background: linear-gradient(140deg, #080808, #454242bf);
2407
+ color: #fff;
2408
+ padding: 0.75rem 1rem;
2409
+ position: relative;
2410
+ border-radius: 10px 10px 0px 0px;
2411
+ }
2412
+ .pwa-prompt-header img {
2413
+ height: 28px;
2414
+ margin-right: 0.5rem;
2415
+ }
2416
+ .pwa-prompt-header h1 {
2417
+ font-size: 1rem;
2418
+ margin: 0;
2419
+ flex-grow: 1;
2420
+ }
2421
+ .pwa-prompt-close {
2422
+ position: absolute;
2423
+ right: 12px;
2424
+ top: 10px;
2425
+ background: transparent;
2426
+ border: none;
2427
+ color: #fff;
2428
+ font-size: 18px;
2429
+ cursor: pointer;
2430
+ }
2431
+ .pwa-prompt-body {
2432
+ padding: 1rem;
2433
+ font-size: 0.9rem;
2434
+ text-align: center;
2435
+ }
2436
+ .pwa-prompt-actions {
2437
+ text-align: center;
2438
+ padding: 0.75rem 1rem 1rem;
2439
+ }
2440
+ .pwa-prompt-actions button {
2441
+ background: #c33031;
2442
+ color: #fff;
2443
+ border: none;
2444
+ padding: 0.6rem 1.2rem;
2445
+ border-radius: 6px;
2446
+ cursor: pointer;
2447
+ font-size: 0.9rem;
2448
+ }
2449
+ .pwa-steps ol {
2450
+ padding-left: 1.25rem;
2451
+ text-align: left;
2452
+ }
2453
+ .pwa-prompt-actions table {
2454
+ width: 100%;
2455
+ margin: 0;
2456
+ }
2457
+ .pwa-prompt-actions td {
2458
+ padding: 0.5rem;
2459
+ }
2460
+ @keyframes slideUp {
2461
+ from { transform: translate(-50%, 100%); opacity: 0; }
2462
+ to { transform: translate(-50%, 0); opacity: 1; }
2463
+ }`;
2387
2464
  document.head.append(style);
2388
2465
  }
2389
- const backdrop = document.createElement("div");
2390
- backdrop.classList.add("pwa-prompt-backdrop");
2391
2466
  const prompt = document.createElement("div");
2392
2467
  prompt.classList.add("pwa-prompt");
2393
2468
  prompt.innerHTML = `
2394
- <div style="display: flex; padding: 1rem; align-items: center">
2395
- <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" style="height: 40px; width: auto; margin-right: .5rem;" />
2396
- <h1 style="margin: 0">Install ${this.api.options.name}</h1>
2469
+ <div class="pwa-prompt-header">
2470
+ <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" />
2471
+ <h1>Install ${this.api.options.name}</h1>
2472
+ <button class="pwa-prompt-close">&times;</button>
2473
+ </div>
2474
+ <div class="pwa-prompt-body">
2475
+ ${this.deferredPrompt ? "Click below to install the app directly to your device." : "Add this app to your home screen for a faster, fullscreen experience."}
2476
+ </div>
2477
+ <div class="pwa-prompt-actions">
2478
+ ${this.deferredPrompt ? `<button id="installPwaBtn">Install App</button>` : `
2479
+ <table>
2480
+ <tr>
2481
+ <td style="width:40px;text-align:center">
2482
+ ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(1.5)"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>' : '<svg viewBox="0 0 566 670" xmlns="http://www.w3.org/2000/svg" fill="#c33031" height="40px"><path d="M255 12c4-4 10-8 16-8s12 3 16 8l94 89c3 4 6 7 8 12 2 6 0 14-5 19-7 8-20 9-28 2l-7-7-57-60 2 54v276c0 12-10 22-22 22-12 1-24-10-23-22V110l1-43-60 65c-5 5-13 8-21 6a19 19 0 0 1-16-17c-1-7 2-13 7-18l95-91z" /><path d="M43 207c16-17 40-23 63-23h83v46h-79c-12 0-25 3-33 13-8 9-10 21-10 33v260c0 13 0 27 6 38 5 12 18 18 30 19l14 1h302c14 0 28 0 40-8 11-7 16-21 16-34V276c0-11-2-24-9-33-8-10-22-13-34-13h-78v-46h75c13 0 25 1 37 4 16 4 31 13 41 27 11 17 14 37 14 57v280c0 20-3 41-15 58a71 71 0 0 1-45 27c-11 2-23 3-34 3H109c-19-1-40-4-56-15-14-9-23-23-27-38-4-12-5-25-5-38V270c1-22 6-47 22-63z" /></svg>'}
2483
+ </td>
2484
+ <td>1) ${android ? "Open the dropdown menu" : 'Tap the "Share" button'}</td>
2485
+ </tr>
2486
+ <tr>
2487
+ <td style="width:40px;text-align:center">
2488
+ ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(-1.5, 1.5)"><path d="M280-40q-33 0-56.5-23.5T200-120v-720q0-33 23.5-56.5T280-920h280v80H280v40h280v80H280v480h400v-80h80v200q0 33-23.5 56.5T680-40H280Zm0-120v40h400v-40H280Zm440-240L520-600l56-56 104 104v-288h80v288l104-104 56 56-200 200ZM280-800v-40 40Zm0 640v40-40Z"/></svg>' : '<svg viewBox="0 0 578 584" xmlns="http://www.w3.org/2000/svg" fill="black" height="34px"><path d="M101 35l19-1h333c12 0 23 0 35 3 17 3 34 12 44 27 13 16 16 38 16 58v329c0 19 0 39-8 57a65 65 0 0 1-37 37c-18 7-38 7-57 7H130c-21 1-44 0-63-10-14-7-25-20-30-34-6-15-8-30-8-45V121c1-21 5-44 19-61 13-16 33-23 53-25m7 46c-10 1-19 6-24 14-7 8-9 20-9 31v334c0 12 2 25 10 34 9 10 23 12 35 12h336c14 1 30-3 38-15 6-9 8-20 8-31V125c0-12-2-24-10-33-9-9-22-12-35-12H121l-13 1z" /><path d="M271 161c9-11 31-10 38 4 3 5 3 11 3 17v87h88c7 0 16 1 21 7 6 6 7 14 6 22a21 21 0 0 1-10 14c-5 4-11 5-17 5h-88v82c0 7-1 15-6 20-10 10-29 10-37-2-3-6-4-13-4-19v-81h-87c-8-1-17-3-23-9-5-6-6-15-4-22a21 21 0 0 1 11-14c6-3 13-3 19-3h84v-88c0-7 1-14 6-20z" /></svg>'}
2489
+ </td>
2490
+ <td>2) Select "Add to Home Screen"</td>
2491
+ </tr>
2492
+ </table>
2493
+ `}
2397
2494
  </div>
2398
- <div style="display: flex; flex-direction: column; align-items: center">
2399
- <div style="border-top: 2px solid #00000020; border-bottom: 2px solid #00000020; padding: 0 1rem">
2400
- <p style="margin-top: 1rem; text-align: center">
2401
- ${this.deferredPrompt ? "Click the button below to install the app directly to your device." : "This website can be installed as an App! Add it to your home screen for quick access & fullscreen use."}
2402
- </p>
2403
- </div>
2404
- ${this.deferredPrompt ? `<button id="installPwaBtn" style="background:#0B76FC;color:white;border:none;padding:.5rem 1rem;border-radius:5px;cursor:pointer;margin:1rem 0">Install</button>` : `
2405
- <table style="margin: 1.5rem 0">
2406
- <tr>
2407
- <td style="width: 50px; text-align: center">
2408
- ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="black" style="transform: scale(1.5)">...</svg>' : '<svg viewBox="0 0 566 670" xmlns="http://www.w3.org/2000/svg" fill="#0B76FC" height="40px">...</svg>'}
2409
- </td>
2410
- <td><p style="margin: 1rem 0">1) ${android ? "Open the dropdown menu" : 'Press the "Share" button'}</p></td>
2411
- </tr>
2412
- <tr>
2413
- <td style="width: 50px; text-align: center">
2414
- ${android ? '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px">...</svg>' : '<svg viewBox="0 0 578 584" xmlns="http://www.w3.org/2000/svg" fill="black" height="34px">...</svg>'}
2415
- </td>
2416
- <td><p style="margin: 1rem 0">2) Press "Add to Home Screen"</p></td>
2417
- </tr>
2418
- </table>`}
2419
- </div>`;
2420
- const close = document.createElement("button");
2421
- close.classList.add("pwa-prompt-close");
2422
- close.innerText = "x";
2423
- close.onclick = () => {
2424
- prompt.classList.add("exit");
2425
- backdrop.classList.add("exit");
2426
- localStorage.setItem(`${this.api.options.name}:pwa`, "dismissed");
2427
- setTimeout(() => {
2428
- prompt.remove();
2429
- backdrop.remove();
2430
- }, 500);
2495
+ `;
2496
+ const closeBtn = prompt.querySelector(".pwa-prompt-close");
2497
+ const dismissExpiry = ((_a = this.api.options.pwaSettings) == null ? void 0 : _a.dismissExpiry) ?? 7;
2498
+ closeBtn.onclick = () => {
2499
+ dismissExpiry > 0 ? localStorage.setItem(`${this.api.options.name}:pwa`, (/* @__PURE__ */ new Date()).toISOString()) : localStorage.removeItem(`${this.api.options.name}:pwa`);
2500
+ prompt.remove();
2431
2501
  };
2432
- prompt.append(close);
2433
- backdrop.append(prompt);
2434
- document.body.append(backdrop);
2435
- if (this.deferredPrompt) {
2436
- const installBtn = prompt.querySelector("#installPwaBtn");
2437
- if (installBtn) {
2438
- installBtn.onclick = async () => {
2439
- this.deferredPrompt.prompt();
2440
- const choice = await this.deferredPrompt.userChoice;
2441
- if (choice.outcome === "accepted") console.log("PWA installed");
2442
- this.deferredPrompt = null;
2443
- close.click();
2444
- };
2445
- }
2446
- }
2502
+ document.body.append(prompt);
2503
+ if (this.deferredPrompt) this.bindInstallButton();
2447
2504
  }
2448
2505
  }
2449
2506
  class Files {
@@ -3369,7 +3426,7 @@ class Superuser {
3369
3426
  } });
3370
3427
  }
3371
3428
  }
3372
- const version = "1.2.92";
3429
+ const version = "1.3.0";
3373
3430
  class WebRtc {
3374
3431
  constructor(api) {
3375
3432
  __publicField(this, "ice");
@@ -1 +1 @@
1
- {"version":3,"file":"login-pr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,CAAC,KAAK,CAAY;IACzB,oDAAoD;IACpD,IAAI,gBAAmD;gBAE1B,GAAG,EAAE,GAAG,EAAkB,KAAK,EAAE,MAAM,EAAS,OAAO,GAAE,kBAAuB;YAI/F,MAAM;YAqCN,aAAa;IAS3B,6BAA6B;IAC7B,KAAK;IAKL,0CAA0C;IAC1C,MAAM;IAIN,8BAA8B;IAC9B,KAAK,CAAC,KAAK,EAAE,GAAG;CA4BhB"}
package/dist/pwa.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare class PWA {
7
7
  get platform(): 'android' | 'ios' | 'mac' | 'windows' | 'linux' | 'unknown';
8
8
  get pwa(): boolean;
9
9
  constructor(api: Api);
10
+ private bindInstallButton;
10
11
  /** Setup the PWA */
11
12
  setup(manifest?: any): Promise<void>;
12
13
  /** 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;IAqBH,OAAO,CAAC,QAAQ,CAAC,GAAG;IApBhC,OAAO,CAAC,cAAc,CAAa;IAEnC,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,GAAG,IAAI,OAAO,CAEjB;gBAE4B,GAAG,EAAE,GAAG;IAQrC,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IAsC9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAiJzC"}
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;IAqBH,OAAO,CAAC,QAAQ,CAAC,GAAG;IApBhC,OAAO,CAAC,cAAc,CAAa;IAEnC,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,GAAG,IAAI,OAAO,CAEjB;gBAE4B,GAAG,EAAE,GAAG;IAErC,OAAO,CAAC,iBAAiB;IAezB,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IA6D9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAgJzC"}
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.2.92",
5
+ "version": "1.3.0",
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
7
7
  "private": false,
8
8
  "main": "./dist/index.cjs",