valtech-components 2.0.731 → 2.0.732
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/atoms/glow/glow.component.mjs +95 -0
- package/esm2022/lib/components/atoms/glow/types.mjs +2 -0
- package/esm2022/lib/components/organisms/login/login.component.mjs +3 -3
- package/esm2022/lib/services/devices/devices.service.mjs +259 -0
- package/esm2022/lib/services/devices/index.mjs +3 -0
- package/esm2022/lib/services/devices/types.mjs +8 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +7 -1
- package/fesm2022/valtech-components.mjs +355 -5
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/atoms/glow/glow.component.d.ts +42 -0
- package/lib/components/atoms/glow/types.d.ts +40 -0
- package/lib/components/atoms/rights-footer/rights-footer.component.d.ts +1 -1
- package/lib/components/molecules/features-list/features-list.component.d.ts +1 -1
- package/lib/components/organisms/article/article.component.d.ts +3 -3
- package/lib/components/organisms/toolbar/toolbar.component.d.ts +1 -1
- package/lib/services/devices/devices.service.d.ts +73 -0
- package/lib/services/devices/index.d.ts +2 -0
- package/lib/services/devices/types.d.ts +11 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GlowIntensity, GlowMetadata, GlowPosition, GlowShape, GlowSize } from './types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* `val-glow` — wrapper that paints a colored radial or linear gradient behind its
|
|
5
|
+
* projected content. Uses Ionic color tokens, so it respects light/dark theme.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <val-glow [props]="{ color: 'primary', position: 'top', size: 'large' }">
|
|
9
|
+
* <h1>Hero title</h1>
|
|
10
|
+
* <p>Body copy...</p>
|
|
11
|
+
* </val-glow>
|
|
12
|
+
*
|
|
13
|
+
* @example Two-tone radial
|
|
14
|
+
* <val-glow [props]="{ color: 'primary', secondaryColor: 'tertiary', position: 'center' }">
|
|
15
|
+
* ...
|
|
16
|
+
* </val-glow>
|
|
17
|
+
*
|
|
18
|
+
* @example Linear sweep from top
|
|
19
|
+
* <val-glow [props]="{ color: 'success', shape: 'linear', position: 'top', intensity: 'strong' }">
|
|
20
|
+
* ...
|
|
21
|
+
* </val-glow>
|
|
22
|
+
*/
|
|
23
|
+
export declare class GlowComponent {
|
|
24
|
+
props: import("@angular/core").InputSignal<GlowMetadata>;
|
|
25
|
+
protected color: import("@angular/core").Signal<import("@ionic/core").Color>;
|
|
26
|
+
protected secondaryColor: import("@angular/core").Signal<import("@ionic/core").Color>;
|
|
27
|
+
protected hasSecondary: import("@angular/core").Signal<boolean>;
|
|
28
|
+
protected position: import("@angular/core").Signal<GlowPosition>;
|
|
29
|
+
protected size: import("@angular/core").Signal<GlowSize>;
|
|
30
|
+
protected intensity: import("@angular/core").Signal<GlowIntensity>;
|
|
31
|
+
protected shape: import("@angular/core").Signal<GlowShape>;
|
|
32
|
+
protected animated: import("@angular/core").Signal<boolean>;
|
|
33
|
+
protected blendMode: import("@angular/core").Signal<"normal" | "multiply" | "screen" | "overlay" | "soft-light" | "hard-light" | "color-dodge">;
|
|
34
|
+
protected colorRgbVar: import("@angular/core").Signal<string>;
|
|
35
|
+
protected secondaryColorRgbVar: import("@angular/core").Signal<string>;
|
|
36
|
+
protected positionCss: import("@angular/core").Signal<string>;
|
|
37
|
+
protected sizeCss: import("@angular/core").Signal<string>;
|
|
38
|
+
protected intensityValue: import("@angular/core").Signal<string>;
|
|
39
|
+
protected angleCss: import("@angular/core").Signal<string>;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GlowComponent, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GlowComponent, "val-glow", never, { "props": { "alias": "props"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Color } from '@ionic/core';
|
|
2
|
+
/**
|
|
3
|
+
* Origin point of the glow.
|
|
4
|
+
* Maps to a CSS background-position value.
|
|
5
|
+
*/
|
|
6
|
+
export type GlowPosition = 'top-left' | 'top' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right';
|
|
7
|
+
/** Radius preset of the glow halo. */
|
|
8
|
+
export type GlowSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
9
|
+
/** Alpha multiplier applied to the glow color(s). */
|
|
10
|
+
export type GlowIntensity = 'subtle' | 'medium' | 'strong';
|
|
11
|
+
/**
|
|
12
|
+
* Gradient shape:
|
|
13
|
+
* - `radial` — circular halo at `position` (default; matches the showcase / AWS look)
|
|
14
|
+
* - `linear` — directional sweep from `position` outwards (good for full-band backdrops)
|
|
15
|
+
*/
|
|
16
|
+
export type GlowShape = 'radial' | 'linear';
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for `val-glow`.
|
|
19
|
+
*/
|
|
20
|
+
export interface GlowMetadata {
|
|
21
|
+
/** Primary Ionic color of the glow. Default `'primary'`. */
|
|
22
|
+
color?: Color;
|
|
23
|
+
/**
|
|
24
|
+
* Optional second Ionic color for two-tone gradients. When set, the gradient
|
|
25
|
+
* blends `color` → `secondaryColor` → transparent.
|
|
26
|
+
*/
|
|
27
|
+
secondaryColor?: Color;
|
|
28
|
+
/** Where the halo originates. Default `'center'`. */
|
|
29
|
+
position?: GlowPosition;
|
|
30
|
+
/** Halo radius preset. Default `'large'`. */
|
|
31
|
+
size?: GlowSize;
|
|
32
|
+
/** Opacity preset of the color stops. Default `'medium'`. */
|
|
33
|
+
intensity?: GlowIntensity;
|
|
34
|
+
/** Gradient shape. Default `'radial'`. */
|
|
35
|
+
shape?: GlowShape;
|
|
36
|
+
/** Subtle drifting animation. Default `false`. */
|
|
37
|
+
animated?: boolean;
|
|
38
|
+
/** Custom CSS background-blend-mode for the glow layer. Optional advanced tweak. */
|
|
39
|
+
blendMode?: 'normal' | 'multiply' | 'screen' | 'overlay' | 'soft-light' | 'hard-light' | 'color-dodge';
|
|
40
|
+
}
|
|
@@ -39,7 +39,7 @@ 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
|
*/
|
|
@@ -49,7 +49,7 @@ export declare class FeaturesListComponent {
|
|
|
49
49
|
iconSize: number;
|
|
50
50
|
mode: "horizontal" | "vertical";
|
|
51
51
|
gap: "small" | "medium" | "large";
|
|
52
|
-
alignment: "
|
|
52
|
+
alignment: "center" | "start";
|
|
53
53
|
}>;
|
|
54
54
|
/** Resolved icon color (handles Ionic colors and CSS colors) */
|
|
55
55
|
iconColorStyle: import("@angular/core").Signal<string>;
|
|
@@ -57,7 +57,7 @@ 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): {
|
|
@@ -90,9 +90,9 @@ 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?: "
|
|
93
|
+
size?: "default" | "small" | "large";
|
|
94
94
|
fill?: "default" | "clear" | "outline" | "solid";
|
|
95
|
-
type: "
|
|
95
|
+
type: "reset" | "submit" | "button";
|
|
96
96
|
token?: string;
|
|
97
97
|
ref?: any;
|
|
98
98
|
handler?: (value: any) => any;
|
|
@@ -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?: "
|
|
75
|
+
size?: "default" | "small" | "large";
|
|
76
76
|
fill?: "default" | "clear" | "outline" | "solid";
|
|
77
77
|
shape?: "round";
|
|
78
78
|
expand?: "full" | "block";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { AuthService } from '../auth/auth.service';
|
|
3
|
+
import { DeviceInfo, ValtechAuthConfig } from '../auth/types';
|
|
4
|
+
import { MessagingService } from '../firebase/messaging.service';
|
|
5
|
+
import { NotificationPermission } from '../firebase/types';
|
|
6
|
+
import { PreferencesService } from '../preferences/preferences.service';
|
|
7
|
+
import { DeviceRegistrationStatus } from './types';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* DeviceRegistrationService — orquesta el flow combinado de:
|
|
11
|
+
* - `PreferencesService.notificationsMaster` (flag user)
|
|
12
|
+
* - `Notification.permission` del browser
|
|
13
|
+
* - `MessagingService` (FCM: requestPermission, getToken, deleteToken)
|
|
14
|
+
* - Backend `/v2/users/me/devices` (POST/GET/DELETE)
|
|
15
|
+
*
|
|
16
|
+
* Auto-sync:
|
|
17
|
+
* - master=true & permission=granted & sin token → auto-register (silent, sin prompt).
|
|
18
|
+
* - master=false & device registrado → auto-unregister (FCM deleteToken + DELETE backend).
|
|
19
|
+
* - permission=denied → status='error', requiere acción manual del user.
|
|
20
|
+
*
|
|
21
|
+
* Cliente:
|
|
22
|
+
* - `requestAndRegister()` para CTA "permitir notificaciones" (dispara browser prompt).
|
|
23
|
+
* - `unregister()` para "olvidar este dispositivo".
|
|
24
|
+
* - `refreshPermission()` tras volver al tab (focus) — el browser puede haber cambiado el estado.
|
|
25
|
+
*/
|
|
26
|
+
export declare class DeviceRegistrationService {
|
|
27
|
+
private config;
|
|
28
|
+
private platformId;
|
|
29
|
+
private http;
|
|
30
|
+
private messaging;
|
|
31
|
+
private prefs;
|
|
32
|
+
private auth;
|
|
33
|
+
private readonly _permission;
|
|
34
|
+
private readonly _status;
|
|
35
|
+
private readonly _currentToken;
|
|
36
|
+
private readonly _currentDeviceId;
|
|
37
|
+
private readonly _lastError;
|
|
38
|
+
private readonly _isSupported;
|
|
39
|
+
readonly permission: import("@angular/core").Signal<NotificationPermission>;
|
|
40
|
+
readonly status: import("@angular/core").Signal<DeviceRegistrationStatus>;
|
|
41
|
+
readonly currentToken: import("@angular/core").Signal<string>;
|
|
42
|
+
readonly currentDeviceId: import("@angular/core").Signal<string>;
|
|
43
|
+
readonly lastError: import("@angular/core").Signal<string>;
|
|
44
|
+
readonly isSupported: import("@angular/core").Signal<boolean>;
|
|
45
|
+
/** true si el browser puede recibir push y el user ya autorizó */
|
|
46
|
+
readonly canReceive: import("@angular/core").Signal<boolean>;
|
|
47
|
+
private autoSyncInFlight;
|
|
48
|
+
constructor(config: ValtechAuthConfig, platformId: Object, http: HttpClient, messaging: MessagingService, prefs: PreferencesService, auth: AuthService);
|
|
49
|
+
/**
|
|
50
|
+
* CTA explícito del user: dispara `Notification.requestPermission()` + registro.
|
|
51
|
+
* Único método que puede generar el browser prompt.
|
|
52
|
+
*/
|
|
53
|
+
requestAndRegister(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Unregister: borra token FCM + DELETE backend del device actual.
|
|
56
|
+
* Idempotente: si no hay device, no hace nada.
|
|
57
|
+
*/
|
|
58
|
+
unregister(): Promise<void>;
|
|
59
|
+
/** Refresca `permission` desde `Notification.permission` del browser. */
|
|
60
|
+
refreshPermission(): void;
|
|
61
|
+
/** Lista devices del user actual desde backend. Útil para vista Seguridad. */
|
|
62
|
+
listDevices(): Promise<DeviceInfo[]>;
|
|
63
|
+
/** Reintenta el último flow fallido. */
|
|
64
|
+
retry(): Promise<void>;
|
|
65
|
+
/** Register sin prompt — asume permission ya granted. */
|
|
66
|
+
private registerSilent;
|
|
67
|
+
private registerDeviceBackend;
|
|
68
|
+
private detectSupport;
|
|
69
|
+
private detectEnv;
|
|
70
|
+
private errorMessage;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceRegistrationService, never>;
|
|
72
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DeviceRegistrationService>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Devices types específicos del `DeviceRegistrationService`.
|
|
3
|
+
* Los contratos base (`RegisterDeviceRequest`, `RegisterDeviceResponse`,
|
|
4
|
+
* `ListDevicesResponse`, `DeviceInfo`, `DevicePlatform`) viven en `auth/types.ts`
|
|
5
|
+
* — este archivo solo agrega lo que falta.
|
|
6
|
+
*/
|
|
7
|
+
export type DeviceRegistrationStatus = 'idle' | 'registering' | 'registered' | 'unregistering' | 'error';
|
|
8
|
+
export interface DeleteDeviceResponse {
|
|
9
|
+
operationId: string;
|
|
10
|
+
deleted: boolean;
|
|
11
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './lib/components/atoms/avatar/avatar.component';
|
|
|
3
3
|
export * from './lib/components/atoms/avatar/types';
|
|
4
4
|
export * from './lib/components/atoms/box/box.component';
|
|
5
5
|
export * from './lib/components/atoms/box/types';
|
|
6
|
+
export * from './lib/components/atoms/glow/glow.component';
|
|
7
|
+
export * from './lib/components/atoms/glow/types';
|
|
6
8
|
export * from './lib/components/atoms/container/container.component';
|
|
7
9
|
export * from './lib/components/atoms/container/types';
|
|
8
10
|
export * from './lib/components/atoms/button/button.component';
|
|
@@ -247,6 +249,7 @@ export * from './lib/services/firebase';
|
|
|
247
249
|
export * from './lib/services/auth';
|
|
248
250
|
export * from './lib/services/i18n';
|
|
249
251
|
export * from './lib/services/preferences';
|
|
252
|
+
export * from './lib/services/devices';
|
|
250
253
|
export * from './lib/services/app-config';
|
|
251
254
|
export * from './lib/services/presets';
|
|
252
255
|
export * from './lib/services/skeleton';
|