valtech-components 2.0.830 → 2.0.832
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/debug-console/config.mjs +44 -0
- package/esm2022/lib/components/organisms/debug-console/debug-console.component.mjs +237 -0
- package/esm2022/lib/components/organisms/debug-console/types.mjs +12 -0
- package/esm2022/lib/services/firebase/notifications.service.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/valtech-components.mjs +290 -2
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/debug-console/config.d.ts +37 -0
- package/lib/components/organisms/debug-console/debug-console.component.d.ts +44 -0
- package/lib/components/organisms/debug-console/types.d.ts +27 -0
- package/lib/services/firebase/notifications.service.d.ts +0 -2
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DebugConsole Provider
|
|
3
|
+
*
|
|
4
|
+
* Provider e injection token para el overlay de logs `val-debug-console`.
|
|
5
|
+
*/
|
|
6
|
+
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
7
|
+
import { DebugConsoleConfig } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Token de inyección para la configuración de DebugConsole.
|
|
10
|
+
*/
|
|
11
|
+
export declare const VALTECH_DEBUG_CONSOLE: InjectionToken<Required<DebugConsoleConfig>>;
|
|
12
|
+
/**
|
|
13
|
+
* Provee el overlay de logs `val-debug-console` a la aplicación Angular.
|
|
14
|
+
*
|
|
15
|
+
* El componente parchea `console.*` para espejar cada llamada a un panel en
|
|
16
|
+
* pantalla — útil para leer logs en un PWA iOS añadido al home screen, donde
|
|
17
|
+
* la consola del navegador no es accesible.
|
|
18
|
+
*
|
|
19
|
+
* El gate `enabled` lo decide la app (la lib no puede importar su
|
|
20
|
+
* `environment`). Sin provider, el componente queda inerte (`enabled: false`).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // main.ts
|
|
25
|
+
* import { provideValtechDebugConsole } from 'valtech-components';
|
|
26
|
+
* import { environment } from './environments/environment';
|
|
27
|
+
*
|
|
28
|
+
* bootstrapApplication(AppComponent, {
|
|
29
|
+
* providers: [
|
|
30
|
+
* provideValtechDebugConsole({ enabled: !environment.production }),
|
|
31
|
+
* ],
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Luego declarar `<val-debug-console />` una vez en el componente raíz.
|
|
36
|
+
*/
|
|
37
|
+
export declare function provideValtechDebugConsole(config?: DebugConsoleConfig): EnvironmentProviders;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { DebugLogEntry } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DebugConsoleComponent implements OnInit, OnDestroy {
|
|
5
|
+
/** Gate maestro: `false` (sin provider o `enabled: false`) → todo inerte. */
|
|
6
|
+
readonly enabled: boolean;
|
|
7
|
+
readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
8
|
+
readonly entries: import("@angular/core").WritableSignal<DebugLogEntry[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Buffer plano (NO signal). `console.log` puede invocarse dentro de un
|
|
11
|
+
* `effect()`/`computed()`; escribir el signal `entries` ahí mismo dispara
|
|
12
|
+
* NG0600. Acumulamos en este array y volcamos al signal en un microtask,
|
|
13
|
+
* fuera de todo contexto reactivo.
|
|
14
|
+
*/
|
|
15
|
+
private buffer;
|
|
16
|
+
private flushScheduled;
|
|
17
|
+
/** Referencias a los métodos originales para restaurarlos en destroy. */
|
|
18
|
+
private original;
|
|
19
|
+
ngOnInit(): void;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
toggle(): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
copy(): Promise<void>;
|
|
24
|
+
/** Reemplaza los métodos de `console` para espejar cada llamada al buffer. */
|
|
25
|
+
private patchConsole;
|
|
26
|
+
/** Restaura los métodos originales de `console`. */
|
|
27
|
+
private restoreConsole;
|
|
28
|
+
/**
|
|
29
|
+
* Agrega una entrada al buffer plano y programa el volcado al signal.
|
|
30
|
+
* El volcado se difiere a un microtask: `console.log` puede llamarse desde
|
|
31
|
+
* dentro de un `effect()`, y escribir un signal ahí lanzaría NG0600.
|
|
32
|
+
*/
|
|
33
|
+
private push;
|
|
34
|
+
/**
|
|
35
|
+
* Vuelca el buffer al signal `entries` en un microtask — fuera del contexto
|
|
36
|
+
* reactivo desde el que se haya llamado `console.log`. Batchea: múltiples
|
|
37
|
+
* logs del mismo tick resultan en una sola escritura del signal.
|
|
38
|
+
*/
|
|
39
|
+
private scheduleFlush;
|
|
40
|
+
/** Convierte cualquier argumento a una representación legible de una línea. */
|
|
41
|
+
private stringify;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DebugConsoleComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DebugConsoleComponent, "val-debug-console", never, {}, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DebugConsole Types
|
|
3
|
+
*
|
|
4
|
+
* Tipos para el overlay de logs en pantalla (`val-debug-console`).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Configuración del proveedor de DebugConsole.
|
|
8
|
+
*
|
|
9
|
+
* @property enabled - Gate maestro. Cuando es `false` el componente NO parchea
|
|
10
|
+
* `console` y NO renderiza nada. La app decide el valor — normalmente
|
|
11
|
+
* `!environment.production`. Sin provider, el default es `false`.
|
|
12
|
+
*/
|
|
13
|
+
export interface DebugConsoleConfig {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuración por defecto: deshabilitado (inerte).
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_DEBUG_CONSOLE_CONFIG: Required<DebugConsoleConfig>;
|
|
20
|
+
/** Nivel de log capturado. */
|
|
21
|
+
export type DebugLogLevel = 'log' | 'warn' | 'error' | 'info';
|
|
22
|
+
/** Entrada del buffer de logs. */
|
|
23
|
+
export interface DebugLogEntry {
|
|
24
|
+
ts: string;
|
|
25
|
+
level: DebugLogLevel;
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
@@ -21,8 +21,6 @@ export interface NotificationDocument extends FirestoreDocument {
|
|
|
21
21
|
title?: string;
|
|
22
22
|
/** Cuerpo del mensaje */
|
|
23
23
|
body?: string;
|
|
24
|
-
/** URL de imagen */
|
|
25
|
-
image?: string;
|
|
26
24
|
/** Datos personalizados (ej: route, actionType). Legacy — preferir actionRoute + payload */
|
|
27
25
|
data?: Record<string, string>;
|
|
28
26
|
/** Tipo de notificación */
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -181,6 +181,9 @@ export * from './lib/components/organisms/banner/banner.component';
|
|
|
181
181
|
export * from './lib/components/organisms/banner/types';
|
|
182
182
|
export * from './lib/components/organisms/cookie-banner/cookie-banner.component';
|
|
183
183
|
export * from './lib/components/organisms/cookie-banner/types';
|
|
184
|
+
export * from './lib/components/organisms/debug-console/config';
|
|
185
|
+
export * from './lib/components/organisms/debug-console/debug-console.component';
|
|
186
|
+
export * from './lib/components/organisms/debug-console/types';
|
|
184
187
|
export * from './lib/components/organisms/footer/footer.component';
|
|
185
188
|
export * from './lib/components/organisms/form/factory';
|
|
186
189
|
export * from './lib/components/organisms/form/form-footer/form-footer.component';
|