valtech-components 2.0.759 → 2.0.762

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.
@@ -90,7 +90,7 @@ export declare class ArticleComponent implements OnInit {
90
90
  contentInterpolation?: Record<string, string | number>;
91
91
  icon?: import("valtech-components").IconMetada;
92
92
  shape?: "round";
93
- size?: "small" | "large" | "default";
93
+ size?: "default" | "small" | "large";
94
94
  fill?: "default" | "clear" | "outline" | "solid";
95
95
  type: "button" | "submit" | "reset";
96
96
  token?: string;
@@ -72,7 +72,7 @@ export declare class ToolbarComponent implements OnInit {
72
72
  };
73
73
  showFlags?: boolean;
74
74
  color: import("@ionic/core").Color;
75
- size?: "small" | "large" | "default";
75
+ size?: "default" | "small" | "large";
76
76
  fill?: "default" | "clear" | "outline" | "solid";
77
77
  shape?: "round";
78
78
  expand?: "full" | "block";
@@ -4,7 +4,6 @@ import { HandoffService } from './handoff.service';
4
4
  import { OrgSwitchService } from './org-switch.service';
5
5
  import { ValtechAuthConfig } from './types';
6
6
  import { NotificationDocument, NotificationsService } from '../firebase/notifications.service';
7
- import { NotificationClickEvent } from '../firebase/types';
8
7
  import * as i0 from "@angular/core";
9
8
  /** Resultado descriptivo del open() — útil para tests y telemetría. */
10
9
  export type NotificationOpenResult = 'navigated' | 'navigated-after-switch-org' | 'redirected-cross-app' | 'no-action-route' | 'cross-app-unconfigured' | 'handoff-failed';
@@ -24,16 +23,6 @@ export declare class NotificationActionService {
24
23
  * técnicos quedan en console.warn.
25
24
  */
26
25
  open(notif: NotificationDocument): Promise<NotificationOpenResult>;
27
- /**
28
- * Variante para clicks de FCM push (background SW → postMessage).
29
- * Mapea el payload del FCM a la forma de `NotificationDocument` y delega en `open()`.
30
- *
31
- * Diferencias con clicks de inbox Firestore:
32
- * - No hay `id` Firestore → markAsRead se skipea (no aplica).
33
- * - `appId`/`orgId`/`actionRoute` se extraen de `notification.data` (lo que el
34
- * backend `push.SendPush` puso allí) o de `event.action` (parsed por MessagingService).
35
- */
36
- openFromFCM(event: NotificationClickEvent): Promise<NotificationOpenResult>;
37
26
  private activeOrg;
38
27
  /**
39
28
  * Construye URL absoluta para handoff cross-app preservando pathname y otros
@@ -194,6 +194,11 @@ export declare class MessagingService {
194
194
  * ```
195
195
  */
196
196
  isSupported(): Promise<boolean>;
197
+ /**
198
+ * iOS sin estar instalado como PWA standalone — push web no disponible.
199
+ * Aplica a Safari y a Edge/Chrome/Firefox en iOS (todos WebKit por mandato Apple).
200
+ */
201
+ private isIOSWithoutStandalone;
197
202
  /**
198
203
  * Obtiene el token actual sin hacer request.
199
204
  *
package/lib/version.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "2.0.759";
5
+ export declare const VERSION = "2.0.762";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.759",
3
+ "version": "2.0.762",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"
@@ -96,28 +96,33 @@ if (!self.FIREBASE_CONFIG) {
96
96
  event.waitUntil(
97
97
  clients
98
98
  .matchAll({ type: 'window', includeUncontrolled: true })
99
- .then(async (clientList) => {
100
- // Estrategia: el SW NO navega. Solo da foco al client y emite postMessage.
101
- // La app (MessagingService → NotificationActionService.openFromFCM) hace
102
- // routing via Angular Router → SPA navigation + handoff cross-app + switch-org.
103
- // `client.navigate()` haría full reload y compite con Router → ambos pierden.
104
- //
105
- // Solo abrimos nueva ventana (con URL completa) cuando NO hay client abierto;
106
- // ese caso es el único donde el SW SÍ define la URL inicial.
107
- if (clientList.length > 0) {
108
- const client = clientList[0];
109
- // postMessage al primer client — el wire de la app (APP_INITIALIZER de
110
- // provideValtechAuth) recibe y dispatcha NotificationActionService.
99
+ .then((clientList) => {
100
+ // Siempre enviar postMessage para que la app pueda reaccionar
101
+ for (const client of clientList) {
111
102
  client.postMessage(notificationPayload);
112
- if ('focus' in client) {
113
- await client.focus();
103
+ }
104
+
105
+ // Navegar si hay route o url
106
+ if (targetUrl !== '/') {
107
+ for (const client of clientList) {
108
+ if ('navigate' in client) {
109
+ return client.navigate(targetUrl).then((c) => c?.focus());
110
+ }
111
+ }
112
+ // Si no hay cliente abierto, abrir nueva ventana
113
+ if (clients.openWindow) {
114
+ return clients.openWindow(targetUrl);
114
115
  }
115
- return;
116
116
  }
117
117
 
118
- // Sin clients abiertos: openWindow con la URL final ya resuelta.
118
+ // Solo hacer focus si no hay navegación
119
+ for (const client of clientList) {
120
+ if ('focus' in client) {
121
+ return client.focus();
122
+ }
123
+ }
119
124
  if (clients.openWindow) {
120
- return clients.openWindow(targetUrl);
125
+ return clients.openWindow('/');
121
126
  }
122
127
  })
123
128
  );