valtech-components 4.0.161 → 4.0.164
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/esm2022/lib/components/organisms/html-viewer-modal/html-viewer-modal.component.mjs +102 -0
- package/esm2022/lib/components/organisms/profile-view/profile-view.component.mjs +12 -1
- package/esm2022/lib/services/auth/oauth-callback.component.mjs +15 -11
- package/esm2022/lib/services/auth/oauth.service.mjs +38 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/valtech-components.mjs +161 -13
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +2 -2
- package/lib/components/atoms/text/text.component.d.ts +1 -1
- package/lib/components/atoms/user-avatar/user-avatar.component.d.ts +1 -1
- package/lib/components/molecules/content-reaction/content-reaction.component.d.ts +2 -2
- package/lib/components/molecules/cta-card/cta-card.component.d.ts +1 -1
- package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
- package/lib/components/molecules/metric-card/metric-card.component.d.ts +1 -1
- package/lib/components/organisms/account-view/account-view.component.d.ts +1 -1
- package/lib/components/organisms/article/article.component.d.ts +5 -5
- package/lib/components/organisms/auth-cta/auth-cta.component.d.ts +1 -1
- package/lib/components/organisms/html-viewer-modal/html-viewer-modal.component.d.ts +29 -0
- package/lib/components/organisms/login/login.component.d.ts +2 -2
- package/lib/components/organisms/organization-view/organization-view.component.d.ts +1 -1
- package/lib/services/auth/oauth.service.d.ts +1 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/src/lib/services/firebase/firebase-messaging-sw.js +145 -0
|
@@ -39,11 +39,11 @@ export declare class RightsFooterComponent {
|
|
|
39
39
|
/**
|
|
40
40
|
* Computed helper for align prop in template.
|
|
41
41
|
*/
|
|
42
|
-
propsAlign: import("@angular/core").Signal<"
|
|
42
|
+
propsAlign: import("@angular/core").Signal<"left" | "center" | "right">;
|
|
43
43
|
/**
|
|
44
44
|
* Computed helper for color prop in template.
|
|
45
45
|
*/
|
|
46
|
-
propsColor: import("@angular/core").Signal<"
|
|
46
|
+
propsColor: import("@angular/core").Signal<"success" | "medium" | "primary" | "secondary" | "tertiary" | "warning" | "danger" | "light" | "dark">;
|
|
47
47
|
/**
|
|
48
48
|
* Computed helper for withMargin prop in template.
|
|
49
49
|
*/
|
|
@@ -11,7 +11,7 @@ export declare class TextComponent {
|
|
|
11
11
|
*/
|
|
12
12
|
displayContent: import("@angular/core").Signal<string>;
|
|
13
13
|
propsColor: import("@angular/core").Signal<import("@ionic/core").Color>;
|
|
14
|
-
propsSize: import("@angular/core").Signal<"
|
|
14
|
+
propsSize: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge">;
|
|
15
15
|
propsBold: import("@angular/core").Signal<boolean>;
|
|
16
16
|
propsProcessLinks: import("@angular/core").Signal<boolean>;
|
|
17
17
|
propsAllowPartialBold: import("@angular/core").Signal<boolean>;
|
|
@@ -38,7 +38,7 @@ export declare class UserAvatarComponent {
|
|
|
38
38
|
readonly imageUrl: import("@angular/core").Signal<string>;
|
|
39
39
|
/** Iniciales — 1-2 chars derivados de name (preferred) o email prefix. */
|
|
40
40
|
readonly initials: import("@angular/core").Signal<string>;
|
|
41
|
-
readonly sizeClass: import("@angular/core").Signal<"
|
|
41
|
+
readonly sizeClass: import("@angular/core").Signal<"small" | "medium" | "large" | "xlarge" | "xsmall">;
|
|
42
42
|
readonly shapeClass: import("@angular/core").Signal<"circle" | "square">;
|
|
43
43
|
/** Background — explicito o derivado deterministicamente del user. */
|
|
44
44
|
readonly bgColor: import("@angular/core").Signal<string>;
|
|
@@ -43,8 +43,8 @@ export declare class ContentReactionComponent implements OnInit, OnChanges {
|
|
|
43
43
|
commentOnValues: ReactionValue[];
|
|
44
44
|
commentPlaceholder: string;
|
|
45
45
|
maxCommentLength: number;
|
|
46
|
-
emojis: [string, string
|
|
47
|
-
emojiLabels: [string, string
|
|
46
|
+
emojis: [string, string] | [string, string, string];
|
|
47
|
+
emojiLabels: [string, string] | [string, string, string];
|
|
48
48
|
showThankYou: boolean;
|
|
49
49
|
thankYouMessage: string;
|
|
50
50
|
disabled: boolean;
|
|
@@ -35,7 +35,7 @@ export declare class CtaCardComponent {
|
|
|
35
35
|
/** Emitted with the token of the clicked action button */
|
|
36
36
|
onAction: EventEmitter<string>;
|
|
37
37
|
/** Merged configuration with defaults */
|
|
38
|
-
config: import("@angular/core").Signal<CtaCardMetadata & Required<Pick<CtaCardMetadata, "
|
|
38
|
+
config: import("@angular/core").Signal<CtaCardMetadata & Required<Pick<CtaCardMetadata, "borderRadius" | "bordered" | "shadowed" | "align" | "padding">>>;
|
|
39
39
|
getBackground(): string;
|
|
40
40
|
getColor(): string | null;
|
|
41
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<CtaCardComponent, never>;
|
|
@@ -41,7 +41,7 @@ export declare class FeaturesListComponent {
|
|
|
41
41
|
iconColor: string;
|
|
42
42
|
iconSize: number;
|
|
43
43
|
mode: "horizontal" | "vertical";
|
|
44
|
-
gap: "
|
|
44
|
+
gap: "small" | "medium" | "large";
|
|
45
45
|
alignment: "center" | "start";
|
|
46
46
|
imageShape: "circle" | "square";
|
|
47
47
|
maxVisible: number;
|
|
@@ -28,7 +28,7 @@ export declare class MetricCardComponent {
|
|
|
28
28
|
/** Emitted with the token of the clicked action */
|
|
29
29
|
onAction: EventEmitter<string>;
|
|
30
30
|
/** Merged configuration with defaults */
|
|
31
|
-
config: import("@angular/core").Signal<MetricCardMetadata & Required<Pick<MetricCardMetadata, "
|
|
31
|
+
config: import("@angular/core").Signal<MetricCardMetadata & Required<Pick<MetricCardMetadata, "borderRadius" | "bordered" | "shadowed" | "padding">>>;
|
|
32
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<MetricCardComponent, never>;
|
|
33
33
|
static ɵcmp: i0.ɵɵComponentDeclaration<MetricCardComponent, "val-metric-card", never, { "props": { "alias": "props"; "required": false; "isSignal": true; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
34
34
|
}
|
|
@@ -35,7 +35,7 @@ export declare class AccountViewComponent {
|
|
|
35
35
|
* mergea con los defaults — `@Input` gana sobre route data.
|
|
36
36
|
*/
|
|
37
37
|
config?: AccountViewConfig;
|
|
38
|
-
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<AccountViewConfig, "
|
|
38
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<AccountViewConfig, "onOrgSwitched" | "onOrgCreated" | "onLoggedOut" | "onAccountDeleted">> & Pick<AccountViewConfig, "onOrgSwitched" | "onOrgCreated" | "onLoggedOut" | "onAccountDeleted">>;
|
|
39
39
|
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
40
40
|
private get ns();
|
|
41
41
|
readonly orgs: import("@angular/core").WritableSignal<Organization[]>;
|
|
@@ -45,7 +45,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
45
45
|
getVideoElement(element: ArticleElement): ArticleVideoElement;
|
|
46
46
|
getCustomElement(element: ArticleElement): ArticleCustomElement;
|
|
47
47
|
getQuoteTextProps(element: ArticleElement): {
|
|
48
|
-
size: "
|
|
48
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
49
49
|
color: import("@ionic/core").Color;
|
|
50
50
|
content?: string;
|
|
51
51
|
bold: boolean;
|
|
@@ -57,11 +57,11 @@ export declare class ArticleComponent implements OnInit {
|
|
|
57
57
|
linkConfig?: import("valtech-components").LinkProcessorConfig;
|
|
58
58
|
allowPartialBold?: boolean;
|
|
59
59
|
authorColor?: import("@ionic/core").Color;
|
|
60
|
-
alignment?: "
|
|
60
|
+
alignment?: "left" | "center" | "right";
|
|
61
61
|
showQuoteMark?: boolean;
|
|
62
62
|
};
|
|
63
63
|
getHighlightTextProps(element: ArticleElement): {
|
|
64
|
-
size: "
|
|
64
|
+
size: "small" | "medium" | "large" | "xlarge";
|
|
65
65
|
color: import("@ionic/core").Color;
|
|
66
66
|
content?: string;
|
|
67
67
|
bold: boolean;
|
|
@@ -94,8 +94,8 @@ export declare class ArticleComponent implements OnInit {
|
|
|
94
94
|
icon?: import("valtech-components").IconMetada;
|
|
95
95
|
shape?: "round";
|
|
96
96
|
size?: "default" | "small" | "large";
|
|
97
|
-
fill?: "
|
|
98
|
-
type: "
|
|
97
|
+
fill?: "default" | "clear" | "outline" | "solid";
|
|
98
|
+
type: "reset" | "submit" | "button";
|
|
99
99
|
token?: string;
|
|
100
100
|
ref?: any;
|
|
101
101
|
handler?: (value: any) => any;
|
|
@@ -35,7 +35,7 @@ export declare class AuthCtaComponent {
|
|
|
35
35
|
onRegister: EventEmitter<void>;
|
|
36
36
|
constructor();
|
|
37
37
|
/** Merged configuration with defaults */
|
|
38
|
-
config: import("@angular/core").Signal<AuthCtaMetadata & Required<Pick<AuthCtaMetadata, "
|
|
38
|
+
config: import("@angular/core").Signal<AuthCtaMetadata & Required<Pick<AuthCtaMetadata, "borderRadius" | "align" | "padding">>>;
|
|
39
39
|
loginLabel: import("@angular/core").Signal<string>;
|
|
40
40
|
registerLabel: import("@angular/core").Signal<string>;
|
|
41
41
|
topLogoProps: import("@angular/core").Signal<{
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* `val-html-viewer-modal` — Modal para visualizar y descargar/imprimir HTML.
|
|
4
|
+
* Se abre como sheet a pantalla completa en móviles.
|
|
5
|
+
*
|
|
6
|
+
* Renderiza HTML embebido en un iframe (los estilos deben estar inline o
|
|
7
|
+
* embebidos en el HTML). Botones de Imprimir (print via iframe) y Descargar
|
|
8
|
+
* (blob export). Toolbar con botón Cerrar.
|
|
9
|
+
*
|
|
10
|
+
* Uso: ModalService.openSheet({ component: HtmlViewerModalComponent, componentProps: { html: "...", title: "..." } })
|
|
11
|
+
*
|
|
12
|
+
* Props:
|
|
13
|
+
* - html: string — HTML completo con estilos embebidos (requerido)
|
|
14
|
+
* - title: string — Nombre del archivo a descargar (default: "documento")
|
|
15
|
+
*
|
|
16
|
+
* El componente recibe `_modalRef` inyectado por ModalService para cerrar.
|
|
17
|
+
*/
|
|
18
|
+
export declare class HtmlViewerModalComponent {
|
|
19
|
+
html: string;
|
|
20
|
+
title: string;
|
|
21
|
+
_modalRef?: {
|
|
22
|
+
dismiss: () => Promise<boolean>;
|
|
23
|
+
};
|
|
24
|
+
dismiss(): void;
|
|
25
|
+
printContent(): void;
|
|
26
|
+
downloadContent(): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HtmlViewerModalComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HtmlViewerModalComponent, "val-html-viewer-modal", never, { "html": { "alias": "html"; "required": false; }; "title": { "alias": "title"; "required": false; }; }, {}, never, never, true, never>;
|
|
29
|
+
}
|
|
@@ -48,12 +48,12 @@ export declare class LoginComponent implements OnInit, OnDestroy {
|
|
|
48
48
|
private _mfaVerifyFormState;
|
|
49
49
|
private _mfaMethod;
|
|
50
50
|
/** Método MFA pendiente — expuesto al template para gatear el link de backup (solo TOTP). */
|
|
51
|
-
readonly mfaMethod: import("@angular/core").Signal<"
|
|
51
|
+
readonly mfaMethod: import("@angular/core").Signal<"EMAIL" | "SMS" | "TOTP">;
|
|
52
52
|
/** A: el user togglea a "código de respaldo" (8 chars alfanuméricos) cuando perdió el 2º factor. */
|
|
53
53
|
readonly mfaUseBackupCode: import("@angular/core").WritableSignal<boolean>;
|
|
54
54
|
isMFAResetModalOpen: boolean;
|
|
55
55
|
private _mfaResetStep;
|
|
56
|
-
readonly mfaResetStep: import("@angular/core").Signal<"
|
|
56
|
+
readonly mfaResetStep: import("@angular/core").Signal<"confirm" | "request">;
|
|
57
57
|
private _mfaResetFormState;
|
|
58
58
|
private _mfaResetEmail;
|
|
59
59
|
private _forgotPasswordFormState;
|
|
@@ -51,7 +51,7 @@ export declare class OrganizationViewComponent {
|
|
|
51
51
|
* `resolvedConfig` mergea con los defaults — `@Input` gana sobre route data.
|
|
52
52
|
*/
|
|
53
53
|
config?: OrganizationViewConfig;
|
|
54
|
-
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<OrganizationViewConfig, "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted"
|
|
54
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<OrganizationViewConfig, "onOrgCreated" | "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted">> & Pick<OrganizationViewConfig, "onOrgCreated" | "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg" | "onOrgDeleted">>;
|
|
55
55
|
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
56
56
|
private get ns();
|
|
57
57
|
readonly org: import("@angular/core").WritableSignal<Organization>;
|
|
@@ -44,6 +44,7 @@ export declare class OAuthService {
|
|
|
44
44
|
private popup;
|
|
45
45
|
private messageHandler;
|
|
46
46
|
private checkClosedInterval;
|
|
47
|
+
private broadcastChannel;
|
|
47
48
|
/**
|
|
48
49
|
* Nonce del flujo OAuth en curso (M-07). Vive SOLO en memoria — un XSS no lo
|
|
49
50
|
* puede leer de localStorage/sessionStorage. Viaja al backend (client_nonce),
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -211,6 +211,7 @@ export * from './lib/components/organisms/banner/banner.component';
|
|
|
211
211
|
export * from './lib/components/organisms/banner/types';
|
|
212
212
|
export * from './lib/components/organisms/change-password-modal/change-password-modal.component';
|
|
213
213
|
export * from './lib/components/organisms/change-email-modal/change-email-modal.component';
|
|
214
|
+
export * from './lib/components/organisms/html-viewer-modal/html-viewer-modal.component';
|
|
214
215
|
export * from './lib/components/organisms/share-profile-modal/share-profile-modal.component';
|
|
215
216
|
export * from './lib/components/organisms/share-profile-modal/types';
|
|
216
217
|
export * from './lib/components/organisms/fun-modal/fun-modal.component';
|
|
@@ -459,4 +460,5 @@ export * from './lib/components/molecules/ticket-card/ticket-card.component';
|
|
|
459
460
|
export * from './lib/components/molecules/ticket-card/types';
|
|
460
461
|
export * from './lib/components/organisms/qr-scanner/qr-scanner.component';
|
|
461
462
|
export * from './lib/components/organisms/qr-scanner/types';
|
|
463
|
+
export * from './lib/components/organisms/html-viewer-modal/html-viewer-modal.component';
|
|
462
464
|
export * from './lib/components/molecules/form-field/form-field.component';
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firebase Messaging Service Worker
|
|
3
|
+
*
|
|
4
|
+
* Service Worker estático para Firebase Cloud Messaging.
|
|
5
|
+
* Carga la configuración dinámicamente desde /firebase-config.js.
|
|
6
|
+
*
|
|
7
|
+
* CONFIGURACIÓN:
|
|
8
|
+
* 1. Crea firebase.config.json con tu configuración de Firebase
|
|
9
|
+
* 2. Ejecuta: npm run generate:firebase-config
|
|
10
|
+
* Esto genera /firebase-config.js con: self.FIREBASE_CONFIG = {...}
|
|
11
|
+
* 3. Agrega este SW y firebase-config.js a los assets de angular.json
|
|
12
|
+
*
|
|
13
|
+
* Ver README.md para documentación completa.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Importar Firebase scripts
|
|
17
|
+
importScripts('https://www.gstatic.com/firebasejs/10.7.0/firebase-app-compat.js');
|
|
18
|
+
importScripts('https://www.gstatic.com/firebasejs/10.7.0/firebase-messaging-compat.js');
|
|
19
|
+
|
|
20
|
+
// Importar configuración desde archivo externo (generado en build)
|
|
21
|
+
// Este archivo define: self.FIREBASE_CONFIG = { ... }
|
|
22
|
+
try {
|
|
23
|
+
importScripts('/firebase-config.js');
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.error('[SW] No se pudo cargar firebase-config.js:', e);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Verificar que la configuración existe
|
|
29
|
+
if (!self.FIREBASE_CONFIG) {
|
|
30
|
+
console.error('[SW] FIREBASE_CONFIG no está definido.');
|
|
31
|
+
console.error('[SW] Ejecuta: npm run generate:firebase-config');
|
|
32
|
+
} else {
|
|
33
|
+
// Inicializar Firebase
|
|
34
|
+
firebase.initializeApp(self.FIREBASE_CONFIG);
|
|
35
|
+
|
|
36
|
+
// Obtener instancia de messaging
|
|
37
|
+
const messaging = firebase.messaging();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Handler para mensajes en background.
|
|
41
|
+
*/
|
|
42
|
+
messaging.onBackgroundMessage((payload) => {
|
|
43
|
+
console.log('[SW] Mensaje recibido en background:', payload);
|
|
44
|
+
|
|
45
|
+
// Web push usa mensajes data-only (sin bloque `notification`) para que el
|
|
46
|
+
// navegador NO auto-muestre una notificación duplicada — el SW es el único
|
|
47
|
+
// que la pinta. Title/body/icon llegan dentro de `data`. Se mantiene el
|
|
48
|
+
// fallback a `payload.notification` por compatibilidad con mensajes
|
|
49
|
+
// legacy o nativos que sí traen el bloque.
|
|
50
|
+
const data = payload.data || {};
|
|
51
|
+
const notificationTitle =
|
|
52
|
+
payload.notification?.title || data.title || 'Nueva notificación';
|
|
53
|
+
const notificationBody = payload.notification?.body || data.body || '';
|
|
54
|
+
const notificationIcon =
|
|
55
|
+
payload.notification?.icon || data.icon || '/assets/icon/favicon.ico';
|
|
56
|
+
|
|
57
|
+
const notificationOptions = {
|
|
58
|
+
body: notificationBody,
|
|
59
|
+
icon: notificationIcon,
|
|
60
|
+
image: payload.notification?.image,
|
|
61
|
+
badge: '/assets/icon/badge.png',
|
|
62
|
+
tag: payload.messageId || data.messageId || 'default',
|
|
63
|
+
data: {
|
|
64
|
+
...data,
|
|
65
|
+
messageId: payload.messageId || data.messageId,
|
|
66
|
+
title: notificationTitle,
|
|
67
|
+
body: notificationBody,
|
|
68
|
+
},
|
|
69
|
+
vibrate: [200, 100, 200],
|
|
70
|
+
requireInteraction: data.require_interaction === 'true',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return self.registration.showNotification(notificationTitle, notificationOptions);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Handler para clicks en notificaciones.
|
|
78
|
+
*/
|
|
79
|
+
self.addEventListener('notificationclick', (event) => {
|
|
80
|
+
console.log('[SW] Click en notificación:', event);
|
|
81
|
+
event.notification.close();
|
|
82
|
+
|
|
83
|
+
const data = event.notification.data || {};
|
|
84
|
+
let targetUrl = '/';
|
|
85
|
+
|
|
86
|
+
if (data.route) {
|
|
87
|
+
targetUrl = data.route;
|
|
88
|
+
} else if (data.url) {
|
|
89
|
+
targetUrl = data.url;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (data.query_params) {
|
|
93
|
+
const separator = targetUrl.includes('?') ? '&' : '?';
|
|
94
|
+
targetUrl += separator + data.query_params;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const notificationPayload = {
|
|
98
|
+
type: 'NOTIFICATION_CLICK',
|
|
99
|
+
notification: {
|
|
100
|
+
title: data.title,
|
|
101
|
+
body: data.body,
|
|
102
|
+
data: data,
|
|
103
|
+
messageId: data.messageId,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
event.waitUntil(
|
|
108
|
+
clients
|
|
109
|
+
.matchAll({ type: 'window', includeUncontrolled: true })
|
|
110
|
+
.then((clientList) => {
|
|
111
|
+
// Siempre enviar postMessage para que la app pueda reaccionar
|
|
112
|
+
for (const client of clientList) {
|
|
113
|
+
client.postMessage(notificationPayload);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Navegar si hay route o url
|
|
117
|
+
if (targetUrl !== '/') {
|
|
118
|
+
for (const client of clientList) {
|
|
119
|
+
if ('navigate' in client) {
|
|
120
|
+
return client.navigate(targetUrl).then((c) => c?.focus());
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Si no hay cliente abierto, abrir nueva ventana
|
|
124
|
+
if (clients.openWindow) {
|
|
125
|
+
return clients.openWindow(targetUrl);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Solo hacer focus si no hay navegación
|
|
130
|
+
for (const client of clientList) {
|
|
131
|
+
if ('focus' in client) {
|
|
132
|
+
return client.focus();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (clients.openWindow) {
|
|
136
|
+
return clients.openWindow('/');
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
self.addEventListener('notificationclose', (event) => {
|
|
143
|
+
console.log('[SW] Notificación cerrada:', event.notification.tag);
|
|
144
|
+
});
|
|
145
|
+
}
|