valtech-components 2.0.1014 → 2.0.1015
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/molecules/content-reaction/content-reaction.component.mjs +16 -4
- package/esm2022/lib/components/molecules/content-reaction/types.mjs +1 -1
- package/esm2022/lib/components/organisms/about-view/about-view.component.mjs +27 -5
- package/esm2022/lib/components/organisms/about-view/types.mjs +1 -1
- package/esm2022/lib/components/organisms/settings-hub/settings-menu.mjs +2 -2
- package/esm2022/lib/components/templates/docs-page/docs-page.component.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +41 -9
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/content-reaction/content-reaction.component.d.ts +12 -1
- package/lib/components/molecules/content-reaction/types.d.ts +8 -0
- package/lib/components/organisms/about-view/about-view.component.d.ts +1 -0
- package/lib/components/organisms/about-view/types.d.ts +9 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/assets/fonts/Khula/khula-300-latin-ext.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-300-latin.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-400-latin-ext.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-400-latin.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-600-latin-ext.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-600-latin.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-700-latin-ext.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-700-latin.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-800-latin-ext.woff2 +0 -0
- package/src/lib/assets/fonts/Khula/khula-800-latin.woff2 +0 -0
- package/src/lib/services/firebase/firebase-messaging-sw.js +145 -0
- package/styles/fonts.scss +35 -3
|
@@ -23,6 +23,14 @@ export declare class ContentReactionComponent implements OnInit, OnChanges {
|
|
|
23
23
|
private auth;
|
|
24
24
|
readonly isConfigured: import("@angular/core").Signal<boolean>;
|
|
25
25
|
props: Partial<ContentReactionMetadata>;
|
|
26
|
+
/**
|
|
27
|
+
* Referencia al modal inyectada por `ModalService` cuando el componente se
|
|
28
|
+
* abre como modal/sheet (`componentProps._modalRef`). Permite cerrarse desde
|
|
29
|
+
* dentro (botón de cierre). `undefined` en uso inline.
|
|
30
|
+
*/
|
|
31
|
+
_modalRef?: {
|
|
32
|
+
dismiss: (data?: unknown, role?: string) => Promise<boolean>;
|
|
33
|
+
};
|
|
26
34
|
reactionSubmit: EventEmitter<ReactionSubmitEvent>;
|
|
27
35
|
reactionChange: EventEmitter<ReactionChangeEvent>;
|
|
28
36
|
state: import("@angular/core").WritableSignal<ContentReactionState>;
|
|
@@ -42,11 +50,14 @@ export declare class ContentReactionComponent implements OnInit, OnChanges {
|
|
|
42
50
|
disabled: boolean;
|
|
43
51
|
readonly: boolean;
|
|
44
52
|
variant: "buttons" | "emoji";
|
|
53
|
+
showCloseButton: boolean;
|
|
45
54
|
}>;
|
|
46
55
|
readonly activeReactionValues: import("@angular/core").Signal<ReactionValue[]>;
|
|
47
56
|
showCommentField: import("@angular/core").Signal<boolean>;
|
|
48
57
|
canSubmit: import("@angular/core").Signal<boolean>;
|
|
49
58
|
constructor();
|
|
59
|
+
/** Cierra el modal/sheet contenedor (si el componente se abrió vía ModalService). */
|
|
60
|
+
close(): void;
|
|
50
61
|
ngOnInit(): void;
|
|
51
62
|
ngOnChanges(changes: SimpleChanges): void;
|
|
52
63
|
private loadPreviousReaction;
|
|
@@ -58,5 +69,5 @@ export declare class ContentReactionComponent implements OnInit, OnChanges {
|
|
|
58
69
|
isSelected(value: ReactionValue): boolean;
|
|
59
70
|
t(key: string): string;
|
|
60
71
|
static ɵfac: i0.ɵɵFactoryDeclaration<ContentReactionComponent, never>;
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ContentReactionComponent, "val-content-reaction", never, { "props": { "alias": "props"; "required": false; }; }, { "reactionSubmit": "reactionSubmit"; "reactionChange": "reactionChange"; }, never, never, true, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ContentReactionComponent, "val-content-reaction", never, { "props": { "alias": "props"; "required": false; }; "_modalRef": { "alias": "_modalRef"; "required": false; }; }, { "reactionSubmit": "reactionSubmit"; "reactionChange": "reactionChange"; }, never, never, true, never>;
|
|
62
73
|
}
|
|
@@ -54,6 +54,14 @@ export interface ContentReactionMetadata {
|
|
|
54
54
|
* Default: false
|
|
55
55
|
*/
|
|
56
56
|
allowAnonymous?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Muestra un botón de cierre (X) arriba a la derecha. Pensado para cuando el
|
|
59
|
+
* componente se abre como modal/sheet (ej. la vista About lo abre vía
|
|
60
|
+
* `ModalService`): al hacer click se cierra el modal usando el `_modalRef` que
|
|
61
|
+
* inyecta `ModalService`. Inerte (sin efecto) en uso inline sin modal.
|
|
62
|
+
* Default: false.
|
|
63
|
+
*/
|
|
64
|
+
showCloseButton?: boolean;
|
|
57
65
|
}
|
|
58
66
|
/**
|
|
59
67
|
* Estado interno del componente.
|
|
@@ -48,6 +48,7 @@ export declare class AboutViewComponent {
|
|
|
48
48
|
private get ns();
|
|
49
49
|
readonly brandName: import("@angular/core").Signal<string>;
|
|
50
50
|
readonly logoSrc: import("@angular/core").Signal<string>;
|
|
51
|
+
readonly logoVar: import("@angular/core").Signal<string>;
|
|
51
52
|
readonly version: import("@angular/core").Signal<string>;
|
|
52
53
|
readonly socialLinks: import("@angular/core").Signal<{
|
|
53
54
|
icon: string;
|
|
@@ -21,6 +21,15 @@ export interface AboutBrand {
|
|
|
21
21
|
name?: string;
|
|
22
22
|
/** Ruta del logo. Default `'assets/images/main-icon.png'`. */
|
|
23
23
|
logoSrc?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Nombre de una CSS custom property (ej. `'--main-logo-mini'`) cuyo valor es un
|
|
26
|
+
* `url(...)` con el logo de marca. Si se pasa, el HERO renderiza el logo como
|
|
27
|
+
* background de la variable — **theme-aware** (cambia con dark mode si la app
|
|
28
|
+
* redefine la variable) — en vez del `<img src=logoSrc>`. Tiene prioridad sobre
|
|
29
|
+
* `logoSrc`. Pensado para el patrón del factory donde cada app define
|
|
30
|
+
* `--main-logo`/`--main-logo-mini` en su `variables.scss`.
|
|
31
|
+
*/
|
|
32
|
+
logoVar?: string;
|
|
24
33
|
}
|
|
25
34
|
/**
|
|
26
35
|
* Acción genérica extra de la sección "Acciones" (además del rating built-in).
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
+
}
|
package/styles/fonts.scss
CHANGED
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: 'Nunito Sans';
|
|
3
|
-
src: url('../src/lib/assets/fonts/Nunito_Sans/NunitoSans-VariableFont_YTLC\,opsz\,wdth\,wght.ttf')
|
|
3
|
+
src: url('../src/lib/assets/fonts/Nunito_Sans/NunitoSans-VariableFont_YTLC\,opsz\,wdth\,wght.ttf')
|
|
4
|
+
format('truetype-variations');
|
|
4
5
|
font-weight: 200 900;
|
|
5
6
|
font-style: normal;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
@font-face {
|
|
9
10
|
font-family: 'Nunito Sans';
|
|
10
|
-
src: url('../src/lib/assets/fonts/Nunito_Sans/NunitoSans-Italic-VariableFont_YTLC\,opsz\,wdth\,wght.ttf')
|
|
11
|
+
src: url('../src/lib/assets/fonts/Nunito_Sans/NunitoSans-Italic-VariableFont_YTLC\,opsz\,wdth\,wght.ttf')
|
|
12
|
+
format('truetype-variations');
|
|
11
13
|
font-weight: 200 900;
|
|
12
14
|
font-style: italic;
|
|
13
|
-
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
+
// Khula — fuente de marca de la app Bingo (self-hosted, subsets latin + latin-ext).
|
|
19
|
+
// NO es la fuente default de la lib (esa es Nunito Sans). Una app la activa con
|
|
20
|
+
// `--ion-font-family: "Khula", ...` en su `theme/variables.scss`. Al self-hostearla
|
|
21
|
+
// acá, cualquier frontend del factory la hereda igual que Nunito Sans (sin Google
|
|
22
|
+
// Fonts/CDN). Pesos 300/400/600/700/800. Solo se descarga si una app la usa.
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
$khula-latin: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD';
|
|
25
|
+
$khula-latin-ext: 'U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF';
|
|
26
|
+
|
|
27
|
+
@each $w in (300, 400, 600, 700, 800) {
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: 'Khula';
|
|
30
|
+
src: url('../src/lib/assets/fonts/Khula/khula-#{$w}-latin-ext.woff2') format('woff2');
|
|
31
|
+
font-weight: $w;
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-display: swap;
|
|
34
|
+
unicode-range: #{$khula-latin-ext};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@font-face {
|
|
38
|
+
font-family: 'Khula';
|
|
39
|
+
src: url('../src/lib/assets/fonts/Khula/khula-#{$w}-latin.woff2') format('woff2');
|
|
40
|
+
font-weight: $w;
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
unicode-range: #{$khula-latin};
|
|
44
|
+
}
|
|
45
|
+
}
|