@rxap/service-worker 16.0.0-dev.15 → 16.0.0-dev.17

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [16.0.0-dev.17](https://gitlab.com/rxap/packages/compare/@rxap/service-worker@16.0.0-dev.16...@rxap/service-worker@16.0.0-dev.17) (2023-09-22)
7
+
8
+ ### Bug Fixes
9
+
10
+ - add debug messages ([cb516ec](https://gitlab.com/rxap/packages/commit/cb516ec639338709feaa390de4499dcab35d5d00))
11
+
12
+ # [16.0.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/service-worker@16.0.0-dev.15...@rxap/service-worker@16.0.0-dev.16) (2023-09-19)
13
+
14
+ ### Features
15
+
16
+ - add dialog update service ([c92d9c8](https://gitlab.com/rxap/packages/commit/c92d9c803eb705516db057b183e8577ba355f6fd))
17
+
6
18
  # [16.0.0-dev.15](https://gitlab.com/rxap/packages/compare/@rxap/service-worker@16.0.0-dev.14...@rxap/service-worker@16.0.0-dev.15) (2023-09-12)
7
19
 
8
20
  ### Bug Fixes
package/README.md CHANGED
@@ -17,5 +17,5 @@ yarn add @rxap/service-worker
17
17
  ```
18
18
  **Install peer dependencies:**
19
19
  ```bash
20
- yarn add @angular/core@^16.1.4 @angular/material@^16.1.4 @angular/service-worker@^16.1.4 @rxap/environment@* @rxap/life-cycle@* rxjs@^7.8.0 tslib@2.6.2
20
+ yarn add @angular/core@^16.1.4 @angular/material@^16.1.4 @angular/service-worker@^16.1.4 @rxap/environment@^16.0.0-dev.15 @rxap/life-cycle@^16.0.0-dev.14 @rxap/ngx-error@^16.0.1-dev.4 rxjs@^7.8.0 tslib@2.6.2
21
21
  ```
package/esm2022/index.mjs CHANGED
@@ -1,10 +1,21 @@
1
- export * from './lib/service-worker-prompt-update.module';
2
- export * from './lib/log-update.service';
3
- export * from './lib/check-for-update.service';
1
+ // region prompt-update
4
2
  export * from './lib/prompt-update/prompt-update.component.module';
5
3
  export * from './lib/prompt-update/prompt-update.component';
6
4
  export * from './lib/prompt-update/prompt-update.service';
7
- export * from './lib/snack-bar-update.service';
5
+ // endregion
6
+ // region dialog service-worker-update-dialog
7
+ export * from './lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component';
8
+ // endregion
9
+ // region dialog
10
+ export * from './lib/dialog/dialog-update.service';
11
+ export * from './lib/dialog/provide-service-worker-update-dialog';
12
+ // endregion
13
+ // region
14
+ export * from './lib/check-for-update.service';
15
+ export * from './lib/log-update.service';
16
+ export * from './lib/service-worker-prompt-update.module';
8
17
  export * from './lib/service-worker-snack-bar-update.module';
18
+ export * from './lib/snack-bar-update.service';
9
19
  export * from './lib/unregister-service-worker';
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL3NlcnZpY2Utd29ya2VyL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDJDQUEyQyxDQUFDO0FBQzFELGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxnQ0FBZ0MsQ0FBQztBQUMvQyxjQUFjLG9EQUFvRCxDQUFDO0FBQ25FLGNBQWMsNkNBQTZDLENBQUM7QUFDNUQsY0FBYywyQ0FBMkMsQ0FBQztBQUMxRCxjQUFjLGdDQUFnQyxDQUFDO0FBQy9DLGNBQWMsOENBQThDLENBQUM7QUFDN0QsY0FBYyxpQ0FBaUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2Utd29ya2VyLXByb21wdC11cGRhdGUubW9kdWxlJztcbmV4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vci11cGRhdGUuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9sb2ctdXBkYXRlLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZS13b3JrZXItcHJvbXB0LXVwZGF0ZS5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZS13b3JrZXItc25hY2stYmFyLXVwZGF0ZS5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc25hY2stYmFyLXVwZGF0ZS5zZXJ2aWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3VucmVnaXN0ZXItc2VydmljZS13b3JrZXInO1xuLy8gZW5kcmVnaW9uXG4iXX0=
@@ -0,0 +1,61 @@
1
+ import { ApplicationRef, createComponent, Inject, Injectable, Injector, } from '@angular/core';
2
+ import { SwUpdate, } from '@angular/service-worker';
3
+ import { ErrorDialogComponent } from '@rxap/ngx-error';
4
+ import { concatMap, tap, } from 'rxjs/operators';
5
+ import { UPDATE_AVAILABLE_EVENT } from './service-worker-update-dialog/service-worker-update-dialog.component';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@angular/service-worker";
8
+ export class DialogUpdateService {
9
+ constructor(applicationRef, updates) {
10
+ this.applicationRef = applicationRef;
11
+ this.updates = updates;
12
+ }
13
+ start() {
14
+ console.debug('start dialog update service');
15
+ this.updates.available
16
+ .pipe(concatMap((event) => this.openUpdateDialog(event)), tap(() => console.log('start app update')), tap(() => this.updates.activateUpdate().then(() => {
17
+ console.log('app update completed. Reload app.');
18
+ document.location.reload();
19
+ })))
20
+ .subscribe();
21
+ }
22
+ openUpdateDialog(event) {
23
+ console.debug('open update dialog');
24
+ const body = document.getElementsByTagName('body')[0];
25
+ const div = document.createElement('div');
26
+ body.appendChild(div);
27
+ const componentRef = createComponent(ErrorDialogComponent, {
28
+ hostElement: div,
29
+ environmentInjector: this.applicationRef.injector,
30
+ elementInjector: Injector.create({
31
+ providers: [
32
+ {
33
+ provide: UPDATE_AVAILABLE_EVENT,
34
+ useValue: event,
35
+ },
36
+ ],
37
+ }),
38
+ });
39
+ this.applicationRef.attachView(componentRef.hostView);
40
+ return componentRef.instance.closeDialog.pipe(tap(() => {
41
+ componentRef.destroy();
42
+ body.removeChild(div);
43
+ div.remove();
44
+ }));
45
+ }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, deps: [{ token: ApplicationRef }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
47
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, providedIn: 'root' }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, decorators: [{
50
+ type: Injectable,
51
+ args: [{
52
+ providedIn: 'root',
53
+ }]
54
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef, decorators: [{
55
+ type: Inject,
56
+ args: [ApplicationRef]
57
+ }] }, { type: i1.SwUpdate, decorators: [{
58
+ type: Inject,
59
+ args: [SwUpdate]
60
+ }] }]; } });
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLXVwZGF0ZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9zZXJ2aWNlLXdvcmtlci9zcmMvbGliL2RpYWxvZy9kaWFsb2ctdXBkYXRlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLGNBQWMsRUFDZCxlQUFlLEVBQ2YsTUFBTSxFQUNOLFVBQVUsRUFDVixRQUFRLEdBQ1QsTUFBTSxlQUFlLENBQUM7QUF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jb21wb25lbnRSZWYgPSBjcmVhdGVDb21wb25lbnQoRXJyb3JEaWFsb2dDb21wb25lbnQsIHtcbiAgICAgIGhvc3RFbGVtZW50OiBkaXYsXG4gICAgICBlbnZpcm9ubWVudEluamVjdG9yOiB0aGlzLmFwcGxpY2F0aW9uUmVmLmluamVjdG9yLFxuICAgICAgZWxlbWVudEluamVjdG9yOiBJbmplY3Rvci5jcmVhdGUoe1xuICAgICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBwcm92aWRlOiBVUERBVEVfQVZBSUxBQkxFX0VWRU5ULFxuICAgICAgICAgICAgdXNlVmFsdWU6IGV2ZW50LFxuICAgICAgICAgIH0sXG4gICAgICAgIF0sXG4gICAgICB9KSxcbiAgICB9KTtcbiAgICB0aGlzLmFwcGxpY2F0aW9uUmVmLmF0dGFjaFZpZXcoY29tcG9uZW50UmVmLmhvc3RWaWV3KTtcblxuICAgIHJldHVybiBjb21wb25lbnRSZWYuaW5zdGFuY2UuY2xvc2VEaWFsb2cucGlwZShcbiAgICAgIHRhcCgoKSA9PiB7XG4gICAgICAgIGNvbXBvbmVudFJlZi5kZXN0cm95KCk7XG4gICAgICAgIGJvZHkucmVtb3ZlQ2hpbGQoZGl2KTtcbiAgICAgICAgZGl2LnJlbW92ZSgpO1xuICAgICAgfSksXG4gICAgKTtcbiAgfVxufVxuIl19
@@ -0,0 +1,11 @@
1
+ import { APP_INITIALIZER, } from '@angular/core';
2
+ import { DialogUpdateService } from './dialog-update.service';
3
+ export function ProvideServiceWorkerUpdateDialog() {
4
+ return {
5
+ provide: APP_INITIALIZER,
6
+ multi: true,
7
+ useFactory: (dus) => () => dus.start(),
8
+ deps: [DialogUpdateService],
9
+ };
10
+ }
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdmlkZS1zZXJ2aWNlLXdvcmtlci11cGRhdGUtZGlhbG9nLmpzIiwic291cmNlUm9vdCI6IiIs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ERpYWxvZ1VwZGF0ZVNlcnZpY2UgXSxcbiAgfTtcbn1cbiJdfQ==
@@ -0,0 +1,28 @@
1
+ import { Component, ElementRef, EventEmitter, inject, InjectionToken, Output, ViewChild, } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export const UPDATE_AVAILABLE_EVENT = new InjectionToken('UPDATE_AVAILABLE_EVENT');
4
+ export class ServiceWorkerUpdateDialogComponent {
5
+ constructor() {
6
+ this.closeDialog = new EventEmitter();
7
+ this.updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);
8
+ }
9
+ ngAfterViewInit() {
10
+ this.dialog.nativeElement.showModal();
11
+ }
12
+ close() {
13
+ this.dialog.nativeElement.close();
14
+ this.closeDialog.emit();
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
17
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ServiceWorkerUpdateDialogComponent, isStandalone: true, selector: "rxap-service-worker-update-dialog", outputs: { closeDialog: "closeDialog" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, static: true }], ngImport: i0, template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n", styles: [""] }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, decorators: [{
20
+ type: Component,
21
+ args: [{ selector: 'rxap-service-worker-update-dialog', standalone: true, imports: [], template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n" }]
22
+ }], propDecorators: { dialog: [{
23
+ type: ViewChild,
24
+ args: ['dialog', { static: true }]
25
+ }], closeDialog: [{
26
+ type: Output
27
+ }] } });
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS13b3JrZXItdXBkYXRlLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL3NlcnZpY2Utd29ya2VyL3NyYy9saWIvZGlhbG9nL3NlcnZpY2Utd29ya2VyLXVwZGF0ZS1kaWFsb2cvc2VydmljZS13b3JrZXItdXBkYXRlLWRpYWxvZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyL3NlcnZpY2Utd29ya2VyL3NyYy9saWIvZGlhbG9nL3NlcnZpY2Utd29ya2VyLXVwZGF0ZS1kaWFsb2cvc2VydmljZS13b3JrZXItdXBkYXRlLWRpYWxvZy5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwsU0FBUyxFQUNULFVBQVU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2RhbCgpO1xuICB9XG5cbiAgY2xvc2UoKSB7XG4gICAgdGhpcy5kaWFsb2cubmF0aXZlRWxlbWVudC5jbG9zZSgpO1xuICAgIHRoaXMuY2xvc2VEaWFsb2cuZW1pdCgpO1xuICB9XG5cbn1cbiIsIjxkaWFsb2cgI2RpYWxvZ1xuICAgICAgICBjbGFzcz1cIm1heC13LTZ4bCByb3VuZGVkIG92ZXJmbG93LWF1dG8gZHJvcC1zaGFkb3ctMnhsIGRhcms6YmctYmxhY2sgZGFyazp0ZXh0LXdoaXRlIGZsZXggZmxleC1jb2wgZ2FwLTMgcC02XCI+XG4gIDxoMiBjbGFzcz1cInRleHQtMnhsIGZvbnQtYm9sZFwiIGkxOG4+QSBuZXcgYXBwbGljYXRpb24gdmVyc2lvbiBpcyBhdmFpbGFibGU8L2gyPlxuICA8dGFibGUgY2xhc3M9XCJ0YWJsZS1hdXRvXCI+XG4gICAgPHRyPlxuICAgICAgPHRoPkN1cnJlbnQgdmVyc2lvbiBoYXNoPC90aD5cbiAgICAgIDx0ZD57e3VwZGF0ZUF2YWlsYWJsZUV2ZW50LmN1cnJlbnQuaGFzaH19PC90ZD5cbiAgICA8L3RyPlxuICAgIDx0cj5cbiAgICAgIDx0aD5OZXcgdmVyc2lvbiBoYXNoPC90aD5cbiAgICAgIDx0ZD57e3VwZGF0ZUF2YWlsYWJsZUV2ZW50LmF2YWlsYWJsZS5oYXNofX08L3RkPlxuICAgIDwvdHI+XG4gIDwvdGFibGU+XG4gIDxidXR0b24gKGNsaWNrKT1cImNsb3NlKClcIiBjbGFzcz1cInB4LTQgcHktMiByb3VuZGVkIGJnLXByaW1hcnktNTAwXCIgaTE4bj5VcGRhdGU8L2J1dHRvbj5cbjwvZGlhbG9nPlxuIl19
@@ -1,106 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, NgModule, Inject, Component, ChangeDetectionStrategy } from '@angular/core';
3
- import * as i2 from '@angular/service-worker';
4
- import { SwUpdate } from '@angular/service-worker';
5
- import { startWith, tap, first, concatMap, filter, map, take } from 'rxjs/operators';
2
+ import { Component, ChangeDetectionStrategy, Inject, Injectable, NgModule, InjectionToken, EventEmitter, inject, ViewChild, Output, createComponent, Injector, ApplicationRef, APP_INITIALIZER } from '@angular/core';
3
+ import * as i1 from '@angular/material/dialog';
4
+ import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
6
5
  import { interval } from 'rxjs';
7
- import * as i1 from '@rxap/life-cycle';
6
+ import { tap, first, concatMap, filter, map, take, startWith } from 'rxjs/operators';
7
+ import * as i5 from '@rxap/life-cycle';
8
8
  import { LifeCycleService } from '@rxap/life-cycle';
9
- import * as i1$1 from '@angular/material/dialog';
10
- import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
11
9
  import * as i4 from '@angular/material/button';
12
10
  import { MatButtonModule } from '@angular/material/button';
13
11
  import * as i3 from '@angular/material/tooltip';
14
12
  import { MatTooltipModule } from '@angular/material/tooltip';
15
- import * as i2$1 from '@angular/material/progress-bar';
13
+ import * as i2 from '@angular/material/progress-bar';
16
14
  import { MatProgressBarModule } from '@angular/material/progress-bar';
15
+ import * as i1$1 from '@angular/service-worker';
16
+ import { SwUpdate } from '@angular/service-worker';
17
+ import { ErrorDialogComponent } from '@rxap/ngx-error';
17
18
  import * as i1$2 from '@angular/material/snack-bar';
18
19
  import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
19
20
 
20
- class LogUpdateService {
21
- constructor(updates) {
22
- this.updates = updates;
23
- }
24
- start() {
25
- console.debug('start log update');
26
- this.updates.available.subscribe(event => {
27
- console.log('current version is', event.current);
28
- console.log('available version is', event.available);
29
- });
30
- this.updates.activated.subscribe(event => {
31
- console.log('old version was', event.previous);
32
- console.log('new version is', event.current);
33
- });
34
- }
35
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, deps: [{ token: i2.SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
36
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, providedIn: 'root' }); }
37
- }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, decorators: [{
39
- type: Injectable,
40
- args: [{
41
- providedIn: 'root',
42
- }]
43
- }], ctorParameters: function () { return [{ type: i2.SwUpdate }]; } });
44
- class LogUpdateModule {
45
- constructor(logUpdate) {
46
- logUpdate.start();
47
- }
48
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, deps: [{ token: LogUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
49
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
50
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, decorators: [{
53
- type: NgModule,
54
- args: [{}]
55
- }], ctorParameters: function () { return [{ type: LogUpdateService }]; } });
56
-
57
- class CheckForUpdateService {
58
- constructor(lifeCycle, updates) {
59
- this.lifeCycle = lifeCycle;
60
- this.updates = updates;
61
- }
62
- start() {
63
- if (this.updates.isEnabled) {
64
- console.debug('start check for update');
65
- this.updates.checkForUpdate();
66
- this
67
- .lifeCycle
68
- .whenReady(() => interval(15 * 60 * 1000)
69
- .pipe(startWith(null), tap(() => console.log('check for update')), tap(() => this.updates.checkForUpdate())))
70
- .subscribe();
71
- }
72
- }
73
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, deps: [{ token: LifeCycleService }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
74
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' }); }
75
- }
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, decorators: [{
77
- type: Injectable,
78
- args: [{
79
- providedIn: 'root',
80
- }]
81
- }], ctorParameters: function () { return [{ type: i1.LifeCycleService, decorators: [{
82
- type: Inject,
83
- args: [LifeCycleService]
84
- }] }, { type: i2.SwUpdate, decorators: [{
85
- type: Inject,
86
- args: [SwUpdate]
87
- }] }]; } });
88
- class CheckForUpdateModule {
89
- constructor(checkForUpdate) {
90
- checkForUpdate.start();
91
- }
92
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, deps: [{ token: CheckForUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
93
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
94
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
95
- }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, decorators: [{
97
- type: NgModule,
98
- args: [{}]
99
- }], ctorParameters: function () { return [{ type: CheckForUpdateService, decorators: [{
100
- type: Inject,
101
- args: [CheckForUpdateService]
102
- }] }]; } });
103
-
104
21
  class PromptUpdateComponent {
105
22
  static { this.AUTO_UPDATE_IN = 1000 * 60 * 1.5; }
106
23
  constructor(event, dialogRef, lifecycle) {
@@ -118,7 +35,7 @@ class PromptUpdateComponent {
118
35
  this.subscription?.unsubscribe();
119
36
  }
120
37
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: MatDialogRef }, { token: LifeCycleService }], target: i0.ɵɵFactoryTarget.Component }); }
121
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: PromptUpdateComponent, isStandalone: true, selector: "rxap-prompt-update", ngImport: i0, template: "<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verf\u00FCgung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n", styles: [".version th{padding-right:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
38
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: PromptUpdateComponent, isStandalone: true, selector: "rxap-prompt-update", ngImport: i0, template: "<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verf\u00FCgung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n", styles: [".version th{padding-right:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
122
39
  }
123
40
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PromptUpdateComponent, decorators: [{
124
41
  type: Component,
@@ -131,10 +48,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
131
48
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
132
49
  type: Inject,
133
50
  args: [MAT_DIALOG_DATA]
134
- }] }, { type: i1$1.MatDialogRef, decorators: [{
51
+ }] }, { type: i1.MatDialogRef, decorators: [{
135
52
  type: Inject,
136
53
  args: [MatDialogRef]
137
- }] }, { type: i1.LifeCycleService, decorators: [{
54
+ }] }, { type: i5.LifeCycleService, decorators: [{
138
55
  type: Inject,
139
56
  args: [LifeCycleService]
140
57
  }] }]; } });
@@ -167,10 +84,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
167
84
  args: [{
168
85
  providedIn: 'root',
169
86
  }]
170
- }], ctorParameters: function () { return [{ type: i1$1.MatDialog, decorators: [{
87
+ }], ctorParameters: function () { return [{ type: i1.MatDialog, decorators: [{
171
88
  type: Inject,
172
89
  args: [MatDialog]
173
- }] }, { type: i2.SwUpdate, decorators: [{
90
+ }] }, { type: i1$1.SwUpdate, decorators: [{
174
91
  type: Inject,
175
92
  args: [SwUpdate]
176
93
  }] }]; } });
@@ -193,6 +110,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
193
110
  }]
194
111
  }], ctorParameters: function () { return [{ type: PromptUpdateService }]; } });
195
112
 
113
+ const UPDATE_AVAILABLE_EVENT = new InjectionToken('UPDATE_AVAILABLE_EVENT');
114
+ class ServiceWorkerUpdateDialogComponent {
115
+ constructor() {
116
+ this.closeDialog = new EventEmitter();
117
+ this.updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);
118
+ }
119
+ ngAfterViewInit() {
120
+ this.dialog.nativeElement.showModal();
121
+ }
122
+ close() {
123
+ this.dialog.nativeElement.close();
124
+ this.closeDialog.emit();
125
+ }
126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
127
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ServiceWorkerUpdateDialogComponent, isStandalone: true, selector: "rxap-service-worker-update-dialog", outputs: { closeDialog: "closeDialog" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, static: true }], ngImport: i0, template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n", styles: [""] }); }
128
+ }
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, decorators: [{
130
+ type: Component,
131
+ args: [{ selector: 'rxap-service-worker-update-dialog', standalone: true, imports: [], template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n" }]
132
+ }], propDecorators: { dialog: [{
133
+ type: ViewChild,
134
+ args: ['dialog', { static: true }]
135
+ }], closeDialog: [{
136
+ type: Output
137
+ }] } });
138
+
139
+ class DialogUpdateService {
140
+ constructor(applicationRef, updates) {
141
+ this.applicationRef = applicationRef;
142
+ this.updates = updates;
143
+ }
144
+ start() {
145
+ console.debug('start dialog update service');
146
+ this.updates.available
147
+ .pipe(concatMap((event) => this.openUpdateDialog(event)), tap(() => console.log('start app update')), tap(() => this.updates.activateUpdate().then(() => {
148
+ console.log('app update completed. Reload app.');
149
+ document.location.reload();
150
+ })))
151
+ .subscribe();
152
+ }
153
+ openUpdateDialog(event) {
154
+ console.debug('open update dialog');
155
+ const body = document.getElementsByTagName('body')[0];
156
+ const div = document.createElement('div');
157
+ body.appendChild(div);
158
+ const componentRef = createComponent(ErrorDialogComponent, {
159
+ hostElement: div,
160
+ environmentInjector: this.applicationRef.injector,
161
+ elementInjector: Injector.create({
162
+ providers: [
163
+ {
164
+ provide: UPDATE_AVAILABLE_EVENT,
165
+ useValue: event,
166
+ },
167
+ ],
168
+ }),
169
+ });
170
+ this.applicationRef.attachView(componentRef.hostView);
171
+ return componentRef.instance.closeDialog.pipe(tap(() => {
172
+ componentRef.destroy();
173
+ body.removeChild(div);
174
+ div.remove();
175
+ }));
176
+ }
177
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, deps: [{ token: ApplicationRef }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
178
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, providedIn: 'root' }); }
179
+ }
180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DialogUpdateService, decorators: [{
181
+ type: Injectable,
182
+ args: [{
183
+ providedIn: 'root',
184
+ }]
185
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef, decorators: [{
186
+ type: Inject,
187
+ args: [ApplicationRef]
188
+ }] }, { type: i1$1.SwUpdate, decorators: [{
189
+ type: Inject,
190
+ args: [SwUpdate]
191
+ }] }]; } });
192
+
193
+ function ProvideServiceWorkerUpdateDialog() {
194
+ return {
195
+ provide: APP_INITIALIZER,
196
+ multi: true,
197
+ useFactory: (dus) => () => dus.start(),
198
+ deps: [DialogUpdateService],
199
+ };
200
+ }
201
+
202
+ class CheckForUpdateService {
203
+ constructor(lifeCycle, updates) {
204
+ this.lifeCycle = lifeCycle;
205
+ this.updates = updates;
206
+ }
207
+ start() {
208
+ if (this.updates.isEnabled) {
209
+ console.debug('start check for update');
210
+ this.updates.checkForUpdate();
211
+ this
212
+ .lifeCycle
213
+ .whenReady(() => interval(15 * 60 * 1000)
214
+ .pipe(startWith(null), tap(() => console.log('check for update')), tap(() => this.updates.checkForUpdate())))
215
+ .subscribe();
216
+ }
217
+ }
218
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, deps: [{ token: LifeCycleService }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
219
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' }); }
220
+ }
221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateService, decorators: [{
222
+ type: Injectable,
223
+ args: [{
224
+ providedIn: 'root',
225
+ }]
226
+ }], ctorParameters: function () { return [{ type: i5.LifeCycleService, decorators: [{
227
+ type: Inject,
228
+ args: [LifeCycleService]
229
+ }] }, { type: i1$1.SwUpdate, decorators: [{
230
+ type: Inject,
231
+ args: [SwUpdate]
232
+ }] }]; } });
233
+ class CheckForUpdateModule {
234
+ constructor(checkForUpdate) {
235
+ checkForUpdate.start();
236
+ }
237
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, deps: [{ token: CheckForUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
238
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
239
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule }); }
240
+ }
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckForUpdateModule, decorators: [{
242
+ type: NgModule,
243
+ args: [{}]
244
+ }], ctorParameters: function () { return [{ type: CheckForUpdateService, decorators: [{
245
+ type: Inject,
246
+ args: [CheckForUpdateService]
247
+ }] }]; } });
248
+
249
+ class LogUpdateService {
250
+ constructor(updates) {
251
+ this.updates = updates;
252
+ }
253
+ start() {
254
+ console.debug('start log update');
255
+ this.updates.available.subscribe(event => {
256
+ console.log('current version is', event.current);
257
+ console.log('available version is', event.available);
258
+ });
259
+ this.updates.activated.subscribe(event => {
260
+ console.log('old version was', event.previous);
261
+ console.log('new version is', event.current);
262
+ });
263
+ }
264
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, deps: [{ token: i1$1.SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable }); }
265
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, providedIn: 'root' }); }
266
+ }
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateService, decorators: [{
268
+ type: Injectable,
269
+ args: [{
270
+ providedIn: 'root',
271
+ }]
272
+ }], ctorParameters: function () { return [{ type: i1$1.SwUpdate }]; } });
273
+ class LogUpdateModule {
274
+ constructor(logUpdate) {
275
+ logUpdate.start();
276
+ }
277
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, deps: [{ token: LogUpdateService }], target: i0.ɵɵFactoryTarget.NgModule }); }
278
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
279
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule }); }
280
+ }
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LogUpdateModule, decorators: [{
282
+ type: NgModule,
283
+ args: [{}]
284
+ }], ctorParameters: function () { return [{ type: LogUpdateService }]; } });
285
+
196
286
  class ServiceWorkerPromptUpdateModule {
197
287
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
198
288
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ServiceWorkerPromptUpdateModule, exports: [LogUpdateModule,
@@ -245,7 +335,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
245
335
  }], ctorParameters: function () { return [{ type: i1$2.MatSnackBar, decorators: [{
246
336
  type: Inject,
247
337
  args: [MatSnackBar]
248
- }] }, { type: i2.SwUpdate, decorators: [{
338
+ }] }, { type: i1$1.SwUpdate, decorators: [{
249
339
  type: Inject,
250
340
  args: [SwUpdate]
251
341
  }] }]; } });
@@ -304,9 +394,12 @@ function UnregisterServiceWorker(environment) {
304
394
  }
305
395
  }
306
396
 
397
+ // region prompt-update
398
+ // endregion
399
+
307
400
  /**
308
401
  * Generated bundle index. Do not edit.
309
402
  */
310
403
 
311
- export { CheckForUpdateModule, CheckForUpdateService, LogUpdateModule, LogUpdateService, PromptUpdateComponent, PromptUpdateModule, PromptUpdateService, ServiceWorkerPromptUpdateModule, ServiceWorkerSnackBarUpdateModule, SnackBarUpdateService, SnackBarUpdateServiceModule, UnregisterServiceWorker };
404
+ export { CheckForUpdateModule, CheckForUpdateService, DialogUpdateService, LogUpdateModule, LogUpdateService, PromptUpdateComponent, PromptUpdateModule, PromptUpdateService, ProvideServiceWorkerUpdateDialog, ServiceWorkerPromptUpdateModule, ServiceWorkerSnackBarUpdateModule, ServiceWorkerUpdateDialogComponent, SnackBarUpdateService, SnackBarUpdateServiceModule, UPDATE_AVAILABLE_EVENT, UnregisterServiceWorker };
312
405
  //# sourceMappingURL=rxap-service-worker.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.html","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.service.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.module.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-prompt-update.module.ts","../../../../../packages/angular/service-worker/src/lib/snack-bar-update.service.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-snack-bar-update.module.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {\n }\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n@NgModule({})\nexport class LogUpdateModule {\n\n constructor(logUpdate: LogUpdateService) {\n logUpdate.start();\n }\n\n}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\nimport { interval } from 'rxjs';\nimport { LifeCycleService } from '@rxap/life-cycle';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n }\n }\n\n}\n\n@NgModule({})\nexport class CheckForUpdateModule {\n\n constructor(@Inject(CheckForUpdateService) checkForUpdate: CheckForUpdateService) {\n checkForUpdate.start();\n }\n\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\nimport {\n MAT_DIALOG_DATA,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n interval,\n Subscription,\n} from 'rxjs';\nimport {\n first,\n tap,\n} from 'rxjs/operators';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n@Component({\n selector: 'rxap-prompt-update',\n templateUrl: './prompt-update.component.html',\n styleUrls: [ './prompt-update.component.scss' ],\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: true,\n imports: [\n MatDialogModule,\n MatProgressBarModule,\n MatTooltipModule,\n MatButtonModule,\n ],\n})\nexport class PromptUpdateComponent implements OnInit, OnDestroy {\n public static AUTO_UPDATE_IN = 1000 * 60 * 1.5;\n\n public progress = 1;\n\n public subscription?: Subscription;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public readonly event: UpdateAvailableEvent,\n @Inject(MatDialogRef)\n private readonly dialogRef: MatDialogRef<boolean>,\n @Inject(LifeCycleService)\n private readonly lifecycle: LifeCycleService,\n ) {\n }\n\n public ngOnInit(): void {\n this.subscription = this.lifecycle\n .whenReady(() =>\n interval(100).pipe(\n tap(\n (i) =>\n (this.progress = Math.floor(\n ((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100,\n )),\n ),\n first((i) => i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100),\n tap(() => console.log('start auto update')),\n tap(() => this.dialogRef.close(true)),\n ),\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n}\n","<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verfügung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n filter,\n map,\n take,\n tap,\n} from 'rxjs/operators';\nimport { MatDialog } from '@angular/material/dialog';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PromptUpdateService {\n constructor(\n @Inject(MatDialog)\n private readonly dialog: MatDialog,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.promptUser(event)),\n filter(Boolean),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private promptUser(event: UpdateAvailableEvent): Observable<boolean> {\n const dialogRef = this.dialog.open<PromptUpdateComponent, any, boolean>(\n PromptUpdateComponent,\n {\n data: event,\n },\n );\n\n return dialogRef.afterClosed().pipe(map(Boolean), take(1));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { PromptUpdateService } from './prompt-update.service';\n\n\n@NgModule({\n imports: [\n PromptUpdateComponent,\n ],\n exports: [ PromptUpdateComponent ],\n})\nexport class PromptUpdateModule {\n\n constructor(promptUpdate: PromptUpdateService) {\n promptUpdate.start();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\nimport { PromptUpdateModule } from './prompt-update/prompt-update.component.module';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n PromptUpdateModule,\n ],\n})\nexport class ServiceWorkerPromptUpdateModule {}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { Observable } from 'rxjs';\nimport {\n MatSnackBar,\n MatSnackBarModule,\n} from '@angular/material/snack-bar';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarUpdateService {\n constructor(\n @Inject(MatSnackBar)\n private readonly snackBar: MatSnackBar,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.openSnackBar(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openSnackBar(event: UpdateAvailableEvent): Observable<void> {\n const snackBarRef = this.snackBar.open('New update available', 'update', {\n duration: 25 * 1000,\n data: event,\n });\n\n return snackBarRef.onAction();\n }\n}\n\n@NgModule({\n exports: [ MatSnackBarModule ],\n})\nexport class SnackBarUpdateServiceModule {\n constructor(\n @Inject(SnackBarUpdateService)\n snackBarUpdate: SnackBarUpdateService,\n ) {\n snackBarUpdate.start();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SnackBarUpdateServiceModule } from './snack-bar-update.service';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n SnackBarUpdateServiceModule,\n ],\n})\nexport class ServiceWorkerSnackBarUpdateModule {}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i1.PromptUpdateService"],"mappings":";;;;;;;;;;;;;;;;;;;MASa,gBAAgB,CAAA;AAE3B,IAAA,WAAA,CAA6B,OAAiB,EAAA;QAAjB,IAAO,CAAA,OAAA,GAAP,OAAO,CAAU;KAC7C;IAEM,KAAK,GAAA;AACV,QAAA,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,IAAG;YACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;AACvD,SAAC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,IAAG;YACvC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/C,SAAC,CAAC,CAAC;KACJ;8G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a,CAAC,GAAG,CAAC,CAAC,YAAY,KAAI;gBACnD,OAAO,CAAC,GAAG,CAAC,6BAA6B,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAChE,gBAAA,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;aAClC,CAAC,CAAC,CAAC;YACJ,IAAI,aAAa,CAAC,MAAM,EAAE;AACxB,gBAAA,MAAM,QAAQ,GAAG,OAAO,CACtB,4GAA4G,CAAC,CAAC;AAChH,gBAAA,IAAI,QAAQ,EAAE;oBACZ,QAAQ,CAAC,MAAM,EAAE,CAAC;AACnB,iBAAA;AACF,aAAA;AACH,SAAC,CAAC,CAAC;AACJ,KAAA;AACH;;AClBA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.html","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.service.ts","../../../../../packages/angular/service-worker/src/lib/prompt-update/prompt-update.component.module.ts","../../../../../packages/angular/service-worker/src/lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component.ts","../../../../../packages/angular/service-worker/src/lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component.html","../../../../../packages/angular/service-worker/src/lib/dialog/dialog-update.service.ts","../../../../../packages/angular/service-worker/src/lib/dialog/provide-service-worker-update-dialog.ts","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-prompt-update.module.ts","../../../../../packages/angular/service-worker/src/lib/snack-bar-update.service.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-snack-bar-update.module.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/index.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\nimport {\n MAT_DIALOG_DATA,\n MatDialogModule,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport {\n interval,\n Subscription,\n} from 'rxjs';\nimport {\n first,\n tap,\n} from 'rxjs/operators';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n@Component({\n selector: 'rxap-prompt-update',\n templateUrl: './prompt-update.component.html',\n styleUrls: [ './prompt-update.component.scss' ],\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: true,\n imports: [\n MatDialogModule,\n MatProgressBarModule,\n MatTooltipModule,\n MatButtonModule,\n ],\n})\nexport class PromptUpdateComponent implements OnInit, OnDestroy {\n public static AUTO_UPDATE_IN = 1000 * 60 * 1.5;\n\n public progress = 1;\n\n public subscription?: Subscription;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public readonly event: UpdateAvailableEvent,\n @Inject(MatDialogRef)\n private readonly dialogRef: MatDialogRef<boolean>,\n @Inject(LifeCycleService)\n private readonly lifecycle: LifeCycleService,\n ) {\n }\n\n public ngOnInit(): void {\n this.subscription = this.lifecycle\n .whenReady(() =>\n interval(100).pipe(\n tap(\n (i) =>\n (this.progress = Math.floor(\n ((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100,\n )),\n ),\n first((i) => i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100),\n tap(() => console.log('start auto update')),\n tap(() => this.dialogRef.close(true)),\n ),\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n}\n","<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verfügung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n filter,\n map,\n take,\n tap,\n} from 'rxjs/operators';\nimport { MatDialog } from '@angular/material/dialog';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PromptUpdateService {\n constructor(\n @Inject(MatDialog)\n private readonly dialog: MatDialog,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.promptUser(event)),\n filter(Boolean),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private promptUser(event: UpdateAvailableEvent): Observable<boolean> {\n const dialogRef = this.dialog.open<PromptUpdateComponent, any, boolean>(\n PromptUpdateComponent,\n {\n data: event,\n },\n );\n\n return dialogRef.afterClosed().pipe(map(Boolean), take(1));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { PromptUpdateService } from './prompt-update.service';\n\n\n@NgModule({\n imports: [\n PromptUpdateComponent,\n ],\n exports: [ PromptUpdateComponent ],\n})\nexport class PromptUpdateModule {\n\n constructor(promptUpdate: PromptUpdateService) {\n promptUpdate.start();\n }\n\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n InjectionToken,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\n\nexport const UPDATE_AVAILABLE_EVENT = new InjectionToken<UpdateAvailableEvent>('UPDATE_AVAILABLE_EVENT');\n\n@Component({\n selector: 'rxap-service-worker-update-dialog',\n standalone: true,\n imports: [],\n templateUrl: './service-worker-update-dialog.component.html',\n styleUrls: [ './service-worker-update-dialog.component.scss' ],\n})\nexport class ServiceWorkerUpdateDialogComponent implements AfterViewInit {\n\n @ViewChild('dialog', { static: true })\n public dialog!: ElementRef<HTMLDialogElement>;\n\n @Output()\n public closeDialog = new EventEmitter<void>();\n\n public readonly updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);\n\n ngAfterViewInit() {\n this.dialog.nativeElement.showModal();\n }\n\n close() {\n this.dialog.nativeElement.close();\n this.closeDialog.emit();\n }\n\n}\n","<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <table class=\"table-auto\">\n <tr>\n <th>Current version hash</th>\n <td>{{updateAvailableEvent.current.hash}}</td>\n </tr>\n <tr>\n <th>New version hash</th>\n <td>{{updateAvailableEvent.available.hash}}</td>\n </tr>\n </table>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n","import {\n ApplicationRef,\n createComponent,\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport { ErrorDialogComponent } from '@rxap/ngx-error';\nimport { Observable } from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { UPDATE_AVAILABLE_EVENT } from './service-worker-update-dialog/service-worker-update-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DialogUpdateService {\n constructor(\n @Inject(ApplicationRef)\n private readonly applicationRef: ApplicationRef,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.available\n .pipe(\n concatMap((event) => this.openUpdateDialog(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openUpdateDialog(event: UpdateAvailableEvent): Observable<void> {\n console.debug('open update dialog');\n const body = document.getElementsByTagName('body')[0];\n const div = document.createElement('div');\n body.appendChild(div);\n const componentRef = createComponent(ErrorDialogComponent, {\n hostElement: div,\n environmentInjector: this.applicationRef.injector,\n elementInjector: Injector.create({\n providers: [\n {\n provide: UPDATE_AVAILABLE_EVENT,\n useValue: event,\n },\n ],\n }),\n });\n this.applicationRef.attachView(componentRef.hostView);\n\n return componentRef.instance.closeDialog.pipe(\n tap(() => {\n componentRef.destroy();\n body.removeChild(div);\n div.remove();\n }),\n );\n }\n}\n","import {\n APP_INITIALIZER,\n Provider,\n} from '@angular/core';\nimport { DialogUpdateService } from './dialog-update.service';\n\nexport function ProvideServiceWorkerUpdateDialog(): Provider {\n return {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (dus: DialogUpdateService) => () => dus.start(),\n deps: [ DialogUpdateService ],\n };\n}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\nimport { interval } from 'rxjs';\nimport { LifeCycleService } from '@rxap/life-cycle';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n }\n }\n\n}\n\n@NgModule({})\nexport class CheckForUpdateModule {\n\n constructor(@Inject(CheckForUpdateService) checkForUpdate: CheckForUpdateService) {\n checkForUpdate.start();\n }\n\n}\n","import {\n Injectable,\n NgModule,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {\n }\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n@NgModule({})\nexport class LogUpdateModule {\n\n constructor(logUpdate: LogUpdateService) {\n logUpdate.start();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\nimport { PromptUpdateModule } from './prompt-update/prompt-update.component.module';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n PromptUpdateModule,\n ],\n})\nexport class ServiceWorkerPromptUpdateModule {}\n","import {\n Inject,\n Injectable,\n NgModule,\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent,\n} from '@angular/service-worker';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport { Observable } from 'rxjs';\nimport {\n MatSnackBar,\n MatSnackBarModule,\n} from '@angular/material/snack-bar';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarUpdateService {\n constructor(\n @Inject(MatSnackBar)\n private readonly snackBar: MatSnackBar,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.openSnackBar(event)),\n tap(() => console.log('start app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n private openSnackBar(event: UpdateAvailableEvent): Observable<void> {\n const snackBarRef = this.snackBar.open('New update available', 'update', {\n duration: 25 * 1000,\n data: event,\n });\n\n return snackBarRef.onAction();\n }\n}\n\n@NgModule({\n exports: [ MatSnackBarModule ],\n})\nexport class SnackBarUpdateServiceModule {\n constructor(\n @Inject(SnackBarUpdateService)\n snackBarUpdate: SnackBarUpdateService,\n ) {\n snackBarUpdate.start();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SnackBarUpdateServiceModule } from './snack-bar-update.service';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n SnackBarUpdateServiceModule,\n ],\n})\nexport class ServiceWorkerSnackBarUpdateModule {}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","// region prompt-update\nexport * from './lib/prompt-update/prompt-update.component.module';\nexport * from './lib/prompt-update/prompt-update.component';\nexport * from './lib/prompt-update/prompt-update.service';\n// endregion\n\n// region dialog service-worker-update-dialog\nexport * from './lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component';\n// endregion\n\n// region dialog\nexport * from './lib/dialog/dialog-update.service';\nexport * from './lib/dialog/provide-service-worker-update-dialog';\n// endregion\n\n// region \nexport * from './lib/check-for-update.service';\nexport * from './lib/log-update.service';\nexport * from './lib/service-worker-prompt-update.module';\nexport * from './lib/service-worker-snack-bar-update.module';\nexport * from './lib/snack-bar-update.service';\nexport * from './lib/unregister-service-worker';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.PromptUpdateService","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;MAuCa,qBAAqB,CAAA;AAClB,IAAA,SAAA,IAAA,CAAA,cAAc,GAAG,IAAI,GAAG,EAAE,GAAG,GAAG,CAAC,EAAA;AAM/C,IAAA,WAAA,CAC2C,KAA2B,EAEnD,SAAgC,EAEhC,SAA2B,EAAA;QAJH,IAAK,CAAA,KAAA,GAAL,KAAK,CAAsB;QAEnD,IAAS,CAAA,SAAA,GAAT,SAAS,CAAuB;QAEhC,IAAS,CAAA,SAAA,GAAT,SAAS,CAAkB;QATvC,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;KAWnB;IAEM,QAAQ,GAAA;AACb,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS;aACT,SAAS,CAAC,MACT,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAChB,GAAG,CACD,CAAC,CAAC,MACC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CACzB,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,qBAAqB,CAAC,cAAc,GAAG,GAAG,CAAC,IAAI,GAAG,CAC/D,CAAC,CACL,EACD,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,qBAAqB,CAAC,cAAc,GAAG,GAAG,CAAC,EAC7D,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,EAC3C,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACtC,CACF;AACA,aAAA,SAAS,EAAE,CAAC;KACtC;IAEM,WAAW,GAAA;AAChB,QAAA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AAC,CAAC;AACJ,KAAA;AACH;;AClBA;AAsBA;;ACtBA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
- export * from './lib/service-worker-prompt-update.module';
2
- export * from './lib/log-update.service';
3
- export * from './lib/check-for-update.service';
4
1
  export * from './lib/prompt-update/prompt-update.component.module';
5
2
  export * from './lib/prompt-update/prompt-update.component';
6
3
  export * from './lib/prompt-update/prompt-update.service';
7
- export * from './lib/snack-bar-update.service';
4
+ export * from './lib/dialog/service-worker-update-dialog/service-worker-update-dialog.component';
5
+ export * from './lib/dialog/dialog-update.service';
6
+ export * from './lib/dialog/provide-service-worker-update-dialog';
7
+ export * from './lib/check-for-update.service';
8
+ export * from './lib/log-update.service';
9
+ export * from './lib/service-worker-prompt-update.module';
8
10
  export * from './lib/service-worker-snack-bar-update.module';
11
+ export * from './lib/snack-bar-update.service';
9
12
  export * from './lib/unregister-service-worker';
@@ -0,0 +1,12 @@
1
+ import { ApplicationRef } from '@angular/core';
2
+ import { SwUpdate } from '@angular/service-worker';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DialogUpdateService {
5
+ private readonly applicationRef;
6
+ private readonly updates;
7
+ constructor(applicationRef: ApplicationRef, updates: SwUpdate);
8
+ start(): void;
9
+ private openUpdateDialog;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogUpdateService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogUpdateService>;
12
+ }
@@ -0,0 +1,2 @@
1
+ import { Provider } from '@angular/core';
2
+ export declare function ProvideServiceWorkerUpdateDialog(): Provider;
@@ -0,0 +1,13 @@
1
+ import { AfterViewInit, ElementRef, EventEmitter, InjectionToken } from '@angular/core';
2
+ import { UpdateAvailableEvent } from '@angular/service-worker';
3
+ import * as i0 from "@angular/core";
4
+ export declare const UPDATE_AVAILABLE_EVENT: InjectionToken<UpdateAvailableEvent>;
5
+ export declare class ServiceWorkerUpdateDialogComponent implements AfterViewInit {
6
+ dialog: ElementRef<HTMLDialogElement>;
7
+ closeDialog: EventEmitter<void>;
8
+ readonly updateAvailableEvent: UpdateAvailableEvent;
9
+ ngAfterViewInit(): void;
10
+ close(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServiceWorkerUpdateDialogComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<ServiceWorkerUpdateDialogComponent, "rxap-service-worker-update-dialog", never, {}, { "closeDialog": "closeDialog"; }, never, never, true, never>;
13
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.0.0-dev.15",
2
+ "version": "16.0.0-dev.17",
3
3
  "name": "@rxap/service-worker",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "dependencies": {
@@ -9,8 +9,9 @@
9
9
  "@angular/core": "^16.1.4",
10
10
  "@angular/material": "^16.1.4",
11
11
  "@angular/service-worker": "^16.1.4",
12
- "@rxap/environment": "*",
13
- "@rxap/life-cycle": "*",
12
+ "@rxap/environment": "^16.0.0-dev.15",
13
+ "@rxap/life-cycle": "^16.0.0-dev.14",
14
+ "@rxap/ngx-error": "^16.0.1-dev.4",
14
15
  "rxjs": "^7.8.0"
15
16
  },
16
17
  "author": {
@@ -34,11 +35,15 @@
34
35
  "packageGroup": [
35
36
  {
36
37
  "package": "@rxap/environment",
37
- "version": "16.0.0-dev.13"
38
+ "version": "16.0.0-dev.15"
38
39
  },
39
40
  {
40
41
  "package": "@rxap/life-cycle",
41
- "version": "16.0.0-dev.12"
42
+ "version": "16.0.0-dev.14"
43
+ },
44
+ {
45
+ "package": "@rxap/ngx-error",
46
+ "version": "16.0.1-dev.4"
42
47
  }
43
48
  ]
44
49
  },
@@ -52,7 +57,7 @@
52
57
  "directory": "packages/angular/service-worker"
53
58
  },
54
59
  "sideEffects": false,
55
- "gitHead": "db8e53ef6cfd297abb6f8c4fb54f289f9c971fe4",
60
+ "gitHead": "846a620a91a0612c991d8f3a8ef5893a2a0a292f",
56
61
  "module": "fesm2022/rxap-service-worker.mjs",
57
62
  "typings": "index.d.ts",
58
63
  "exports": {
package/theme.css CHANGED
@@ -1 +1 @@
1
- .visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.block{display:block}.inline{display:inline}.table{display:table}.contents{display:contents}.hidden{display:none}.capitalize{text-transform:capitalize}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}
1
+ .container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.mt-4{margin-top:1rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-20{height:5rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.grow-0{flex-grow:0}.table-auto{table-layout:auto}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-6{row-gap:1.5rem}.gap-y-8{row-gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.overflow-auto{overflow:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.bg-accent-500{background-color:var(--accent-500)}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-primary-500{background-color:var(--primary-500)}.p-10{padding:2.5rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-4{padding-right:1rem}.pt-8{padding-top:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.drop-shadow-2xl{--tw-drop-shadow:drop-shadow(0 25px 25px #00000026)}.drop-shadow-2xl,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-colors{transition-duration:.15s}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:bg-black){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}:is(.dark .dark\:text-black){--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-gray-900:hover){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}